|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface WeightingFunction
An interface for a term weighting function that can be used during retrieval, classification, and profiling operations. Classes that implement this interface will be used in two distinct ways:
initTerm method will be called with the term statistics for
the term. This should result in the calculation and caching of any
collection-level weight for the term. Once initTerm has been called,
the termWeight(WeightingComponents) method will be called repeatedly for
each element in the postings list associated with the term.termWeight(WeightingComponents) method
repeatedly to calculate the weights associated with each term in the
document.
TFIDF,
Okapi| Method Summary | |
|---|---|
float |
initTerm(WeightingComponents wc)
Initializes the weighting function for a particular term. |
float |
termWeight(WeightingComponents wc)
Calculates the weight for a particular term in a particular document, given a set of weighting components. |
| Method Detail |
|---|
float initTerm(WeightingComponents wc)
If a collection level weight is calculated as part of a weighting
function, it must be placed into the
WeightingComponents.wt member. During query processing
any calls to termWeight that follow the call to
initTerm for a given term are guaranteed to pass in the
same WeightingComponents object, so it can be used to
safely cache the collection-level weights. Additionally, it will be
safe to subclass WeightingComponents if necessary.
Note that the term weight computed by this method may be used as the weight of the terms in a query, so if no such weight needs to be calculated for a given implementation, a value of 1 should be used.
wc - a set of weighting components.
WeightingComponents.wtfloat termWeight(WeightingComponents wc)
wc - a set of weighting components.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||