Machine Learning sorting

Source: Internet
Author: User

From the perspective of data types and related machine learning technologies, internet search has experienced three generations of development.

The first generation of technology mainly uses traditional information retrieval methods to view Internet webpages as texts.

The second generation of technology uses the Hypertext Structure of the Internet to effectively calculate the relevance and importance of web pages, representing algorithms such as PageRank.

The third-generation technology, which effectively utilizes log data and statistical learning methods, further improves the accuracy of webpage relevance and importance calculation.Sort Learning, Webpage importance learning, matching learning, topic model learning, and query statement conversion learning.

This section describes machine learning sorting.

1. Learning to rank)

Using Machine Learning Technology to sort search results is a hot research area in recent years. The information retrieval field has been developing for decades. Why is the combination of machine learning and information retrieval technologies coming soon? There are two main reasons.

On the one hand, because the basic search model described in the previous sections shows that there are not many factors to consider when it is used to sort the relevance of inquiry and documents, the ranking formula is manually fitted by factors such as Word Frequency, inverse document frequency, and document length. Because there are not many factors to consider, it is completely feasible to manually perform formula fitting. At this time, machine learning cannot be very useful, because machine learning is more suitable for using many features for formula fitting, at this time, it is unrealistic to expect people to fit dozens of factors into the sorting formula, and machine learning is very suitable for this type of work. With the development of search engines, more and more factors need to be taken into account for sorting a webpage, for example, the pageRank value of a webpage, the number of words that match a query and a document, and the URL link length of a webpage all have an impact on the webpage ranking. Google's current WebPage Ranking formula takes into account more than 200 factors, at this time, the role of machine learning can be realized, which is one of the reasons.
Another reason is: for supervised machine learning, a large amount of training data is required first. On this basis, the sorting model can be automatically learned. It is unrealistic to manually label a large amount of training data. Although a search engine cannot manually mark a large amount of training data, user click records can be used as a substitute for machine learning training data. For example, a user sends a query, when a search engine returns a search result, the user clicks some of the web pages. It can be assumed that the webpage clicked by the user is more relevant to the user query. Although this assumption is often not true, practical experience shows that using this click data to train a machine learning system is indeed feasible.

2. Basic Ideas of machine learning

Traditional search models rely on artificial fitting of sorting formulas and continuous experiments to determine the best combination of parameters to form a correlation scoring function. Machine Learning sorting is different from this idea. The most reasonable sorting formula is obtained by machine automatic learning, while humans need to provide training data for machine learning.

Figure 1 shows the basic principle of sorting by machine learning. The machine learning sorting system consists of four steps: manually tagging training data, extracting document features, learning classification functions, and adopting machine learning models in the actual search system.

Figure 1 Machine Learning sorting principle

 

First, the training data is manually labeled. That is to say, for a query Q, manually mark which documents are related to this query, and mark the degree of relevance. Sometimes the correlation degree can be expressed by numerical sequence, for example, from 1 to 5 is divided into three grades. 1 indicates weak correlation, 5 indicates the most correlation, and other values indicate the correlation between the two. For a query, there may be a large number of related documents, and there may also be a wide variety of user inquiries, so manual tagging is sometimes impossible. In this case, you can use the user click record to simulate this manual scoring mechanism.
For machine learning, the input is a user query and a series of labeled documents. The machine learning system needs to learn the scoring function and then output the search results according to the scoring function, but within it, each document consists of several features, that is, before each document enters the machine learning system, you need to first convert it to my ELE. Me feature vectors. Common features include:

• Query word frequency information in documents
• Query IDF information of a word
• Document length:
• Number of webpage links:
• Number of outbound links on a webpage:
• PageRank value of the webpage;
• URL loose of a webpage:
• Proximity value of the Keyword: All the keyword can appear in the large window of the document.

The above lists only some features that affect sorting. In fact, many similar features can be added as one-dimensional feature vectors. After determining the number of features, you can convert the document to feature vector X. As mentioned above, each document will manually mark its correlation score y. in this way, each document is converted to the form of <X, Y>, that is, the feature vector and its corresponding correlation score, thus forming a specific training instance.

Through multiple training instances, you can use machine learning technology to train the system. The training result is a classification function or regression function. In subsequent user searches, you can use this classification function to score documents to form search results.

From the perspective of current research methods, we can divide machine learning into the following methods: Single-document method, document peer method, and document list method.

 

3. Pointwise Approach

The processing object of a single document method is a separate document. After the document is converted to a feature vector, the Machine Learning System scores the document based on the classification or regression function learned from the training data, the score result is the search result. Here is a simple example to illustrate this method.
Figure 2 is a set of manually labeled training. In this example, we use three features for each document: the Cosme similarity score of the inquiry and the document, the Proximity value of the keyword of the inquiry, and the PageRank value of the page. The correlation judgment is binary, that is, either related or irrelevant. Of course, the correlation determination can be expanded to multiple values according to the degree of correlation. This example simplifies the description for convenience.

Figure 2 training data

Five training instances are provided in this example. Each training instance is labeled with the corresponding query, and the score and correlation of the three features are determined. For machine learning systems, the following linear scoring functions are required based on training data:

Score (Q, D) = a x CS + B x PM + cx PR + d
In this formula, cs represents the Cosine similarity emblem, PM represents the Proximity value variable, PR represents pageRank, and a, B, c, and d represent the parameters corresponding to the variable.

If the score is greater than a set threshold value, it is deemed to be related. If the score is smaller than the set threshold value, it can be considered irrelevant. Through the training instance, you can obtain the optimal combination of a, B, c, and d parameters. After these parameters are determined, The Machine Learning System will finish learning, then you can use this scoring function to determine the correlation. For a new query of Q and document D, the system first obtains the three feature values corresponding to document D, and then uses the learned parameter combination to calculate the scores of the two, when the score is greater than the set threshold value, you can determine that the document is a relevant document; otherwise, the document is considered irrelevant.

 

4. Document method (pairwise approach)

For the search system, the system returns the list of relevant documents after receiving the user's inquiry. The key to the problem is to determine the sequential relationship between documents. The single-document method is calculated from the classification score of a single document without considering the sequential relationship between documents. The document recipient's law will focus on determining whether the document order relationship is reasonable.

It is called the document pair method because the training process and training goal of this machine learning method determine whether the document pairs <D0C1, D0C2> composed of any two documents meet the sequential relationship, that is, determine whether D0C1 should be placed before DOC2. Figure 3 shows a training example: how to convert the search result list corresponding to query Q1 to the form of a document pair, because the correlation score marked manually shows that D0C2 has the highest score, d0C3 followed by D0C1 with the lowest score, so we can get three document pairs shown in 3 according to the order of score size. After converting the documents of each document pair into feature vectors, A specific training instance is formed.

Figure 3 Method Training example of document pair

Based on the converted training instance, you can use the machine learning method to learn classification functions. There are many specific learning methods, suchSVM. Boosts, and neural networks can all be used as learning methods.But no matter what the specific method is, the learning objectives are the same, that is, input-a query and a document pair <docl, doc2>, machine Learning sorting can determine whether this sequence relationship is established. If so, d0c1 should be in front of d0c2 in the search results; otherwise, doe2 should be in front of docl. In this way, to complete the sorting task of the search results.
Although the document has improved the method relative to the single document method, there are two obvious problems with this method:

One problem is that the document only considers the relative sequence of the two document pairs, but does not consider the position where the document appears in the search list. The documents that are at the forefront of the search site are more important, if a judgment error occurs in the top-level documents, the cost is significantly higher than that of the subsequent documents. The improved approach to this problem is to introduce cost-sensitive factors, that is, each document has different weights based on its order in the list, and the higher the weights, that is, if the order of troubleshooting is at the top of the search list, the cost will be higher •
Another problem is that the number of relevant documents varies greatly for different inquiry, so after converting to a document pair, some query pairs can have hundreds of corresponding document pairs, in some queries, there are only a dozen of corresponding document pairs, which makes it difficult to evaluate the effectiveness of the machine learning system. • We imagine there are two queries. For more information, Q1 corresponds to 500 document pairs, query 10 Document pairs corresponding to Q2. Assume that the learning system can determine 480 correct document pairs for analyticdb for SQL. For analyticdb Q2, you can determine 2 correct document pairs, according to the total number of document pairs, the accuracy of this learning system is (480 + 2)/(500 + 10) = 0. 95. that is, the accuracy is 95%, but from the perspective of inquiry, the accuracy of the Two inquiry
They are 96% and 20%, respectively, with an average of 58%, which is far from the accuracy of the judgment simply from the document. This will affect how to continue tuning the machine learning system.

 

4. Document list method (listwise approach)

The single-document method treats each document in the training set as a training instance. The document pair method uses any two document pairs in the search results of the same query as a training instance, the document list method is different from the preceding two representation methods. This means that the entire list of all search results corresponding to each query is used as a training instance, which is also the reason why the document list method is called.
The document list method trains K training instances (one query and all corresponding search results are scored as one instance) to obtain the optimal scoring function F. For a new user, function F scores each document and then sorts the documents in descending order, which is the corresponding search result. Therefore, the key question is: how can we obtain the optimal scoring function after training data?

A training method is introduced here. It is trained based on the probability distribution of the search result arrangement and combination. Figure 4 illustrates the training process in this way.

Figure 4 KL distance of different scoring Functions

 

First, I will explain what is the probability distribution of the search result arrangement and combination. We know that for search engines, users enter question Q and the search engine returns the search result, assume that the search result set contains. the search engine sorts the search results for documents B and C. The three documents are ordered in six ways:

ABC, ACB, BAG, BCA, CAB, and CBA,

Each sort and combination is a possible sorting method for search results.

For A scoring function F, the relevance score of the three search results documents is obtained, and three different relevance scores are obtained: F (A), F (B), and F (C ), based on these three scores, we can calculate the probability values of the six permutation combinations. The probability distribution of the six types of search results is different for different scoring functions.
We learned what is the probability distribution of search result permutation and combination, and how to find the optimal scoring function based on the training instance.Figure 4A specific training example is displayed, that is, the score of Q1 and the corresponding three documents. The score is calculated manually, so it can be seen as a standard answer. We can imagine that there is an optimal scoring function g. for Q1, the score is: document A scored 6 points, document B scored 4 points, and document C scored 3 points, because the score is played manually, we are not clear about the specific function g. Our task is to find a function, make sure that the function scores the Ql search results in the same order as the manual score. Since manual scoring
(Virtual function g) is known, so we can calculate the probability distribution of the search results corresponding to function g. The specific distribution is as follows:Figure 4The probability distribution in the middle is shown. Assume that two other functions h and f exist. Their calculation methods are known, and the corresponding scores for the three search results are displayed on the graph, the probability distribution of the search result arrangement and combination corresponding to each function can also be introduced based on the score result. Which of the following is closer to the virtual optimal Score Function g for h and f? Generally, similarity can be measured by distance between two probability distributions. KL distance is a computing tool used to measure the difference in probability distributions, by calculating the differences between h and g and the differences between f and g, we can see that f is closer to the optimal function g than h. In this function, we should first select f as the scoring function available for future search. The training process is to find the function closest to the virtual optimal function g among the possible functions as the training result, it will be used as a scoring function for searching in the future.

The above example only describes how to find the optimal function through training for a single training instance. In fact, we have K training instances. Even so, the training process is similar to the above description, it can be considered that there is a virtual optimal scoring function g (which is actually a manual scoring function). The training process is to explore all possible candidate functions based on all training instances, select the KL closest to the function g, and use it as the scoring function. Empirical results show that the document list-based Method

The sorting effect of machine learning is better than the preceding two methods.

Disclaimer: this blog is excerpted from "this is a search engine: Core Technology details" Chapter 5 about machine learning sorting. For more information, see the source.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.