public abstract class DependenceScoreModifier extends Object implements DocumentScoreModifier
Properties
QTW Combination Functions
Modifier and Type | Field and Description |
---|---|
protected double |
avgDocLen |
protected String |
dependency
type of proximity to use
|
protected int |
ngramLength
The size of the considered ngrams
|
protected double |
numTokens |
protected int |
phraseQTWfnid |
protected String[] |
phraseTerms
A list of the strings of the phrase terms.
|
protected double |
w_o
weight of ordered dependence model
|
protected double |
w_t
weight of unigram model
|
protected double |
w_u
weight of unordered dependence model
|
Constructor and Description |
---|
DependenceScoreModifier()
Constructs an instance of the DependenceScoreModifier.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a clone of this object
|
protected static int |
countTrue(boolean[] in) |
protected void |
determineGlobalStatistics(String[] terms,
EntryStatistics[] es,
boolean SD)
unused hook method
|
protected void |
doDependency(Index index,
EntryStatistics[] es,
IterablePosting[] ips,
ResultSet rs,
double[] phraseTermWeights,
boolean SD) |
String |
getName()
Returns the name of the modifier.
|
boolean |
modifyScores(Index index,
MatchingQueryTerms terms,
ResultSet set)
Modifies the scores of documents, in which there exist, or there does not
exist a given phrase.
|
protected static boolean |
NOR(boolean[] in) |
protected void |
openPostingLists(Index index,
LexiconEntry[] les,
IterablePosting[] ips)
Opens the posting list for an index and lexicon entry
|
double |
score(Posting[] postings)
Calculate the score for a document (from the given posting for that document)
|
protected double |
scoreFDSD(boolean SD,
int i,
Posting ip1,
int j,
Posting ip2,
double _avgDocLen)
how likely is it that these two postings have so many near-occurrences,
given the length of this document
|
protected abstract double |
scoreFDSD(int matchingNGrams,
int docLength) |
void |
setCollectionStatistics(CollectionStatistics cs,
Index _index)
Sets the collection statistics used to score the documents (number of documents in the collection, etc)
|
protected int ngramLength
protected String dependency
protected final int phraseQTWfnid
protected double w_t
protected double w_o
protected double w_u
protected String[] phraseTerms
protected double avgDocLen
protected double numTokens
public DependenceScoreModifier()
public Object clone()
clone
in interface DocumentScoreModifier
clone
in class Object
protected abstract double scoreFDSD(int matchingNGrams, int docLength)
public String getName()
getName
in interface DocumentScoreModifier
protected static boolean NOR(boolean[] in)
public boolean modifyScores(Index index, MatchingQueryTerms terms, ResultSet set)
modifyScores
in interface DocumentScoreModifier
index
- Index the data structures to use.terms
- MatchingQueryTerms the terms to be matched for the query. This
does not correspond to the phrase terms necessarily, but to
all the terms of the query.set
- ResultSet the result set for the query.protected void determineGlobalStatistics(String[] terms, EntryStatistics[] es, boolean SD) throws IOException
IOException
protected void openPostingLists(Index index, LexiconEntry[] les, IterablePosting[] ips) throws IOException
IOException
protected void doDependency(Index index, EntryStatistics[] es, IterablePosting[] ips, ResultSet rs, double[] phraseTermWeights, boolean SD) throws IOException
IOException
protected static int countTrue(boolean[] in)
public void setCollectionStatistics(CollectionStatistics cs, Index _index)
public double score(Posting[] postings)
Terrier 4.0. Copyright © 2004-2014 University of Glasgow