|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectit.unimi.di.mg4j.search.score.AbstractScorer
it.unimi.di.mg4j.search.score.AbstractWeightedScorer
it.unimi.di.mg4j.search.score.ClarkeCormackScorer
public class ClarkeCormackScorer
Computes the Clarke–Cormack score of all interval iterators of a document. This score function is defined in Charles L.A. Clarke and Gordon V. Cormack, “Shortest-Substring Retrieval and Ranking”, ACM Transactions on Information Systems, 18(1):44−78, 2000, at page 65.
The score for each index depends on two parameters: an integer h and a double α. The score is obtained summing up a certain score assigned to all intervals in the interval iterator under examination. The score assigned to an interval is 1 if the interval has length smaller than h; otherwise, it is obtained by dividing h by the interval length, and raising the result to the power of α.
Note that the score assigned to each interval is between 0 and 1 (highest scores corresponding
to best intervals). The score assigned to an interval iterator is thus bounded from above by the
number of intervals; an alternative version allows one to have normalized scores (in this case, the resulting
value is an average instead of a sum). A scorer with similar relative ranks, but inherently (almost) normalised
is provided by VignaScorer.
Typically, one sets h=16 (or a bit larger) and α=1 (or a bit smaller), but the authors say that the method is rather stable w.r.t. changes in the values of parameters.
| Field Summary | |
|---|---|
double |
alpha
The parameter alpha. |
static int |
DEFAULT_H
The default value for h. |
int |
h
The parameter h. |
boolean |
normalize
Whether the result should be normalized (i.e., between 0 and 1). |
| Fields inherited from class it.unimi.di.mg4j.search.score.AbstractWeightedScorer |
|---|
index2Weight |
| Fields inherited from class it.unimi.di.mg4j.search.score.AbstractScorer |
|---|
documentIterator, indexIterator |
| Constructor Summary | |
|---|---|
ClarkeCormackScorer()
Default constructor, assigning the default values (h= DEFAULT_H, α=1) to the
parameters; the resulting scorer is normalized. |
|
ClarkeCormackScorer(int h,
double alpha,
boolean normalize)
Creates a Clarke–Cormack scorer. |
|
ClarkeCormackScorer(String h,
String alpha,
String normalize)
Creates a Clarke–Cormack scorer. |
|
| Method Summary | |
|---|---|
ClarkeCormackScorer |
copy()
|
double |
score(Index index)
Returns a score for the current document of the last document iterator given to Scorer.wrap(DocumentIterator), but
considering only a given index (optional operation). |
String |
toString()
|
boolean |
usesIntervals()
Returns true. |
| Methods inherited from class it.unimi.di.mg4j.search.score.AbstractWeightedScorer |
|---|
getWeights, score, setWeights, wrap |
| Methods inherited from class it.unimi.di.mg4j.search.score.AbstractScorer |
|---|
nextDocument |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface it.unimi.di.mg4j.search.score.Scorer |
|---|
getWeights, nextDocument, score, setWeights, wrap |
| Field Detail |
|---|
public static final int DEFAULT_H
public final int h
public final double alpha
public final boolean normalize
| Constructor Detail |
|---|
public ClarkeCormackScorer(int h,
double alpha,
boolean normalize)
h - the parameter h.alpha - the parameter α.normalize - whether the result should be normalized.
public ClarkeCormackScorer(String h,
String alpha,
String normalize)
h - the parameter h.alpha - the parameter α.normalize - whether the result should be normalized.public ClarkeCormackScorer()
DEFAULT_H, α=1) to the
parameters; the resulting scorer is normalized.
| Method Detail |
|---|
public ClarkeCormackScorer copy()
copy in interface DelegatingScorercopy in interface Scorercopy in interface FlyweightPrototype<Scorer>
public double score(Index index)
throws IOException
ScorerScorer.wrap(DocumentIterator), but
considering only a given index (optional operation).
score in interface Scorerindex - the only index to be considered.
IOExceptionpublic String toString()
toString in class Objectpublic boolean usesIntervals()
usesIntervals in interface Scorer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||