A method and system for generating a ranking function to rank the relevance of documents to a query is provided. In one embodiment, the ranking system learns a ranking function from a collection of queries, resultant documents, and relevance of each document to its query. For example, the queries may be submitted to a web-based search engine to identify the resultant documents that may satisfy the query. The ranking system then determines the relevance of each resultant document to its query. For example, the ranking system may input from a user the relevance of each document to its query. The queries, documents, and relevances are the training data that the ranking system uses to learn the ranking function. The ranking system learns a ranking function using the training data by weighting incorrect rankings of relevant documents more heavily than the incorrect rankings of not relevant documents so that more emphasis is placed on correctly ranking relevant documents. For example, the ranking system may adjust a loss or error function so that more emphasis is placed on minimizing the error in the ranking function's ranking of relevant documents and less emphasis is placed on the error in the ranking function's ranking of not relevant documents. As a result, the ranking function will more correctly rank relevant documents than it does irrelevant documents. In one embodiment, the ranking system may alternatively learn a ranking function using the training data by normalizing the contribution of each query to the ranking function by factoring in the number of resultant documents (e.g., relevant documents) of each query. As a result, the ranking function will reflect contributions made by each query in a way that is independent of the number of resultant documents. The ranking system may either weight the ranking of relevant documents more heavily or normalize the contribution of a query based on number of documents when generating a ranking function, or use both in combination as described below. As a result, the ranking system can generate a ranking function that results in a ranking that is more desired by typical users of a search engine.
In one embodiment, the ranking system generates a ranking function using training data derived from queries and resultant documents that may be collected by submitting the queries to search engines. The ranking system then inputs a ranking of the relevance of each document to its query. For example, the ranking system may prompt a user to indicate the relevance classification, such as relevant, partially relevant, or irrelevant, indicating the relevance of each document to its query. The ranking system generates a feature vector for each document. The feature vector includes features that are useful for determining the relevance of a document to a query. For example, the feature vector may include a count of the number of times a term of the query occurs in the document, the number of terms in the document, and so on. The ranking system generates a label for ordered pairs of documents with different relevance classifications for each query. For example, a pair of documents may include one relevant document (r) and one irrelevant document (i) resulting in two ordered pairs: (r,i) and (i,r). Thus, if a query has 10 documents with 2 documents being relevant, 3 documents being partially relevant, and 5 documents being irrelevant, then the query has 62 pairs (i.e., 2*(2*3+2*5+3*5)). Each ordered pair is also referred to as an instance pair. The ranking system then generates a label for each instance pair indicating whether the ranking of the documents within the instance pair is correct. For example, the ranking of (r,i) is correct assuming the higher ranking document is first in the pair. If so, then the ranking of (i,r) is incorrect.
In one embodiment, the ranking system uses a rank pair parameter for each pair of relevance classifications. The relevance classification pairs (or ranking pairs) are (relevant, partially relevant), (partially relevant, relevant), (relevant, irrelevant), and so on. The rank pair parameter for a ranking pair indicates a weighting for errors in the learning of the ranking function attributable to instance pairs corresponding to that ranking pair. For example, an error in ranking a (relevant, irrelevant) instance pair will be weighted more heavily than an error in ranking a (partially relevant, irrelevant) instance pair because an incorrect ranking of a relevant document is very undesirable whereas the incorrect ranking of a partially relevant document as irrelevant will probably not be noticed by the user. By weighting errors according to the rank pair parameters, the ranking system generates a ranking function that will more likely generate the correct rankings for relevant documents than for not relevant documents generated by switching documents between the relevance classifications of the rank pair. The rank pair parameters may be specified manually or may be generated automatically. In one embodiment, the ranking system generates the ranking pair parameters automatically by calculating an evaluation measure of the perfect ranking of documents for a query and calculating evaluation measures for various not perfect rankings of the documents. The ranking system may perform these calculations for each query and then use the average of the differences between the perfect evaluation measure and the not perfect evaluation measures as the rank pair parameter. The ranking system may use various evaluation measurements such as mean reciprocal rank, winner take all, mean average precision, and normalized discounted cumulative gain.
In one embodiment, the ranking system uses a query parameter for each query to normalize the contribution of the queries to the generation of the ranking function. The ranking system may generate a query parameter for a query based on the number of resultant documents of that query relative to the maximum number of resultant documents of a query of the collection. The ranking system may set the query parameter of a query to the maximum number of resultant documents divided by the number of resultant documents for the query. The ranking system may more specifically set the query parameter of a query to the maximum number of instance pairs of a query divided by the number of instance pairs of the query, which are derived based on the relevance classifications of the pairs of documents.
The ranking system generates the ranking function using various training techniques such as gradient descent or quadratic programming. When gradient descent is used, the ranking system iteratively adjusts weighting parameters for the feature vector used by the ranking function until the error in the ranking function as applied to the training data converges on a solution. During each iteration, the ranking system applies the ranking function with current weighting parameters to each instance pair. If the ranking is incorrect, the ranking function then calculates an adjustment for the current weighting parameters. That adjustment factors in the rank pair parameter and the query parameter as discussed above. At the end of each iteration, the ranking system calculates new current weighting parameters.
The ranking system may represent documents in an input space X ε Rn where n represents the number of features of a feature vector and may represent rankings (or categories) of the documents in an output space of relevance classifications Y={r1, r2, . . . , rq} where q represents the number of ranks (e.g., relevant, partially relevant, and irrelevant). The ranking system may be implemented using a number of ranks selected based on the goals of the ranking system. A total order between the ranks may be represented as rqrq−1
. . .
r1, where
denotes a ranking relationship. The ranking system learns a ranking function out of a set of possible ranking functions ƒ ε F that each determine the ranking relationship between an instance pair as represented by the following equation:
{right arrow over (x)}
i
{right arrow over (x)}
j
ƒ({right arrow over (x)}i)>ƒ({right arrow over (x)}) (1)
where {right arrow over (x)}i represents the feature vector for document i. The ranking system uses as training data a set of ranked instances S={({right arrow over (x)}i,yi)}i=1t from the space X×Y. The ranking system may generate a linear or non-linear ranking function. A linear ranking function is represented by the following equation:
ƒ{right arrow over (w)}({right arrow over (x)})=<{right arrow over (w)},{right arrow over (x)}> (2)
where {right arrow over (w)} denotes a vector of weighting parameters and <·,·> represents an inner product. By substituting Equation 2 into Equation 1, the resulting equation is represented by the following equation:
{right arrow over (x)}
i
{right arrow over (x)}
j
<{right arrow over (w)},{right arrow over (x)}
i
−{right arrow over (x)}
j>>0 (3)
The relationship {right arrow over (x)}i{right arrow over (x)}j between instance pairs {right arrow over (x)}i and {right arrow over (x)}j is expressed by a new vector {right arrow over (x)}i−{right arrow over (x)}j. The ranking system creates the new vector and a label for each instance pair as represented by the following equation:
where {right arrow over (x)}(1) and {right arrow over (x)}(2) represent the first and second documents and y(1) and y(2) represent their ranks. From the given training data set S, the ranking system creates a new training data set S′ containing labeled vectors as represented by the following equation:
S′={{right arrow over (x)}
i
(1)
−{right arrow over (x)}
i
(2)
,z
i}i=1l (5)
where l represents the number of instance pairs. The ranking system then generates an SVM model from the new training data S′ to assign either positive label z=+1 or negative label z=−1 to any vector {right arrow over (x)}i(1)−{right arrow over (x)}(2). The constructing of the SVM model is equivalent to solving a quadratic optimization problem as represented by the following equation:
where k(i) represents the type of ranks of instance pair i, τk(i) represents the rank pair parameter for k(i), q(i) represents the query of instance pair i, μq(i) represents the query parameter for q(i), and λ∥{right arrow over (w)}∥2 is a regularizer. The ranking system represents a penalty for the ith pair being incorrectly ranked as the product of τk(i) and μq(i).
The ranking system can solve for the loss function of Equation 6 using a gradient descent algorithm. The loss function can be represented by the following equation:
Equation 7 can be differentiated with respect to {right arrow over (w)} as represented by the following equation:
The iteration equations of the gradient descent method may be represented by the following equations:
At each iteration, the ranking system reduces the cost function along its descent direction as represented by Equation 8. To determine the step size of each iteration, the ranking system conducts a line search along the descent direction as described by Equations 9. The ranking system may calculate a learning factor ηk to control the learning rate at each iteration k. In one embodiment, rather than calculating each ηk at each iteration, the ranking system uses a fixed learning factor.
The ranking system alternatively can solve for the loss function of Equation 6 using a quadratic programming algorithm. The loss function can be represented as a quadratic optimization problem as represented by the following equation:
The corresponding Lagrange function can be represented by the following equation:
The goal is to minimize Lp with respect to {right arrow over (w)} and ξi. Setting their derivatives to zero results in the following equations:
αi=Ci−μi i=1, . . . , l (13)
along with the positive constraints αi, μi, ξi i=1, . . . , l. The substitution of Equations 12 and 13 into Equation 11 can be represented by the following equation:
The goal is to maximize LD subject to the constraints represented by the following equation:
0≦αi≦Ci i=1, . . . , l (15)
The computing devices on which the ranking system may be implemented may include a central processing unit, memory, input devices (e.g., keyboard and pointing devices), output devices (e.g., display devices), and storage devices (e.g., disk drives). The memory and storage devices are computer-readable media that may contain instructions that implement the ranking system. In addition, the data structures and message structures may be stored or transmitted via a data transmission medium, such as a signal on a communications link. Various communications links may be used, such as the Internet, a local area network, a wide area network, or a point-to-point dial-up connection.
The ranking system may be implemented on various computing systems or devices including personal computers, server computers, multiprocessor systems, microprocessor-based systems, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The ranking system may also provide its services (e.g., ranking of search results using the ranking function) to various computing systems such as personal computers, cell phones, personal digital assistants, consumer electronics, home automation devices, and so on.
The ranking system may be described in the general context of computer-executable instructions, such as program modules, executed by one or more computers or other devices. Generally, program modules include routines, programs, objects, components, data structures, and so on that perform particular tasks or implement particular abstract data types. Typically, the functionality of the program modules may be combined or distributed as desired in various embodiments. For example, the training component may be implemented on a computer system separate from the computer system that collects the training data or the computer system that uses the ranking function to rank search results.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. The ranking system may be used to rank a variety of different types of documents. For example, the documents may be web pages returned as a search result by a search engine, scholarly articles returned by a journal publication system, records returned by a database system, news reports of a news wire service, and so on. Accordingly, the invention is not limited except as by the appended claims.