|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.gla.terrier.structures.ExpansionTerms
public class ExpansionTerms
This class implements a data structure of terms in the top-retrieved documents.
Properties:
Nested Class Summary | |
---|---|
static class |
ExpansionTerms.ExpansionTerm
This class implements a data structure for a term in the top-retrieved documents. |
Field Summary | |
---|---|
double |
normaliser
The parameter-free term weight normaliser. |
Constructor Summary | |
---|---|
ExpansionTerms(CollectionStatistics collStats,
double totalLength,
Lexicon lexicon)
Constructs an instance of ExpansionTerms. |
|
ExpansionTerms(int numberOfDocuments,
long numberOfTokens,
double averageDocumentLength,
double totalLength,
Lexicon lexicon)
Constructs an instance of ExpansionTerms. |
Method Summary | |
---|---|
void |
assignWeights(QueryExpansionModel QEModel)
Assign weight to terms that are stored in ExpansionTerm[] terms. |
void |
deleteTerm(int termid)
Remove the records for a given term |
double |
getDocumentFrequency(int termId)
Returns the number of the top-ranked documents a given term occurs in. |
SingleTermQuery[] |
getExpandedTerms(int numberOfExpandedTerms,
QueryExpansionModel QEModel)
This method implements the functionality of assigning expansion weights to the terms in the top-retrieved documents, and returns the most informative terms among them. |
double |
getExpansionProbability(int termId)
Returns the probability of a given termid occurring in the expansion documents. |
double |
getExpansionWeight(int termId)
Returns the weight of a term with the given term identifier. |
double |
getExpansionWeight(int termId,
QueryExpansionModel model)
Returns the weight of a term with the given term identifier, computed by the specified query expansion model. |
double |
getExpansionWeight(java.lang.String term)
Returns the weight of a given term. |
double |
getExpansionWeight(java.lang.String term,
QueryExpansionModel model)
Returns the weight of a given term, computed by the specified query expansion model. |
double |
getFrequency(int termId)
Returns the frequency of a given term in the top-ranked documents. |
double |
getFrequency(java.lang.String term)
Returns the frequency of a given term in the top-ranked documents. |
int |
getNumberOfUniqueTerms()
Returns the unique number of terms found in all the top-ranked documents |
double |
getOriginalExpansionWeight(java.lang.String term)
Returns the un-normalised weight of a given term. |
int[] |
getTermIds()
Returns the termids of all terms found in the top-ranked documents |
void |
insertTerm(int termID,
double withinDocumentFrequency)
Add a term in the X top-retrieved documents as a candidate of the expanded terms. |
void |
setOriginalQueryTerms(MatchingQueryTerms query)
Set the original query terms. |
void |
setTotalDocumentLength(double totalLength)
Allows the totalDocumentLength to be set after the fact |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public double normaliser
Constructor Detail |
---|
public ExpansionTerms(CollectionStatistics collStats, double totalLength, Lexicon lexicon)
totalLength
- The sum of the length of the top-retrieved documents.lexicon
- Lexicon The lexicon used for retrieval.public ExpansionTerms(int numberOfDocuments, long numberOfTokens, double averageDocumentLength, double totalLength, Lexicon lexicon)
totalLength
- The sum of the length of the top-retrieved documents.lexicon
- Lexicon The lexicon used for retrieval.Method Detail |
---|
public void setTotalDocumentLength(double totalLength)
public int[] getTermIds()
public int getNumberOfUniqueTerms()
public SingleTermQuery[] getExpandedTerms(int numberOfExpandedTerms, QueryExpansionModel QEModel)
numberOfExpandedTerms
- int The number of terms to extract from the
top-retrieved documents. ConservativeQE is set if this parameter is set to 0.QEModel
- QueryExpansionModel the model used for query expansion
public void setOriginalQueryTerms(MatchingQueryTerms query)
query
- The original query.public void deleteTerm(int termid)
public double getExpansionWeight(java.lang.String term, QueryExpansionModel model)
term
- String the term to set the weight for.model
- QueryExpansionModel the used query expansion model.
public double getExpansionWeight(java.lang.String term)
term
- String the term to get the weight for.
public double getOriginalExpansionWeight(java.lang.String term)
term
- String the given term.
public double getFrequency(java.lang.String term)
term
- String the term to get the frequency for.
public double getFrequency(int termId)
termId
- int the id of the term to get the frequency for.
public double getDocumentFrequency(int termId)
termId
- int the id of the term to get the frequency for.
public void assignWeights(QueryExpansionModel QEModel)
QEModel
- QueryExpansionModel the used query expansion model.public double getExpansionWeight(int termId, QueryExpansionModel model)
termId
- int the term identifier to set the weight for.model
- QueryExpansionModel the used query expansion model.
public double getExpansionWeight(int termId)
termId
- int the term identifier to set the weight for.
public double getExpansionProbability(int termId)
termId
- int the term identifier to obtain the probability
public void insertTerm(int termID, double withinDocumentFrequency)
termID
- int the integer identifier of a termwithinDocumentFrequency
- double the within document
frequency of a term
|
Terrier IR Platform 2.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |