49 #ifndef _CINVERTEDFILEQUERY
50 #define _CINVERTEDFILEQUERY
51 #include "libGIFTQuInvertedFile/include/uses-declarations.h"
54 #include "libMRML/include/CSelfDestroyPointer.h"
55 #include "libMRML/include/CRelevanceLevelList.h"
56 #include "libMRML/include/CIDRelevanceLevelPairList.h"
57 #include "libGIFTQuInvertedFile/include/CWeightingFunctionPointerList.h"
58 #include "libGIFTQuInvertedFile/include/CWeightingFunctionPointerHash.h"
59 #include "libMRML/include/CAlgorithm.h"
60 #include "libMRML/include/CQuery.h"
61 #include "libGIFTAcInvertedFile/include/CAcInvertedFile.h"
62 #include "libGIFTQuInvertedFile/include/CWeightingFunction.h"
63 #include "libGIFTQuInvertedFile/include/CQueryNormalizer.h"
64 #include "libGIFTAcInvertedFile/include/WeightingFunctionsAndNormalizers.h"
68 #include "libGIFTQuInvertedFile/include/CWeighter.h"
128 const CWeightingFunctionPointerList& inFeatures,
129 bool lPositive)
const;
138 const CWeightingFunctionPointerList& inFeatures,
140 int inDesiredNumberOfDocuments)
const;
153 outQueryFeatureWeighters)
const;
161 double inNegativeRelevanceSum,
164 CWeightingFunctionPointerList&
173 double inNegativeRelevanceSum,
224 int inNumberOfInterestingImages,
225 double inDifferenceToBest);
234 int inNumberOfInterestingImages,
235 double inDifferenceToBest);
269 outQueryFeatureWeighters)
const;
275 static const int MAXIMUMNUMBEROFEATUREGROUPS=50;
279 bool mBlockingArray[MAXIMUMNUMBEROFEATUREGROUPS];
322 bool isBlocked(
const int featureNumber)
const;
361 bool mFeaturePruningUsed;
366 bool mTimePruningUsed;
373 bool mEvaluateAfterPruning;
424 double inReduceToFactor);
void buildNormalizedQueryList(double inPositiveRelevanceSum, double inNegativeRelevanceSum, CWeightingFunctionPointerHash &inQFW, CWeightingFunctionPointerList &outQFW) const
Building a list of normalized WF from a hash of Weighting functions.
static const int MAX_SCOREBOARD_PRUNINGS
These are the variables and functions used for the pruning process.
Definition: CQInvertedFile.h:330
void activateBlockingFeatures()
activateBlockingFeatures - sets the variable to block groups of features
void releaseAllPrunings()
sets back all the variables for the pruning
CQInvertedFile(CAccessorAdminCollection &inAccessorAdminCollection, CAlgorithm &inAlgorithm)
New constructor, taking as parameter the algorithm structure, which contains all the algorithm config...
~CWeighterFactory()
Destructor deletes the content it points to.
CSelfDestroyPointer< CWeightingFunctionPointerHash > mQueryFeatureWeighters
object of this type to have a list of the features with the weights
Definition: CQInvertedFile.h:119
Definition: CIDRelevanceLevelPairList.h:52
int mModuloClass
Every lModulo-th feature, starting at lModuloClass.
Definition: CQInvertedFile.h:106
double URLToScore(const string &inURL, const CWeightingFunctionPointerHash &inQuery) const
Returns the score for one image in the query.
bool featuresBlocked() const
featuresBlocked - returns true if the features are blocked
CWeighterFactory()
constructor: initializes everything fills the map etc.
void releaseBlockingFeatures()
releaseBlockingFeatures - this turns off the blocking of features
double mStoppingTime
Henning Müller
Definition: CQInvertedFile.h:368
double DIDToScore(TID inDID, const CWeightingFunctionPointerHash &inQuery) const
Returns the score for one image in the query.
int mNumberofUsedScoreBoardPrunings
Henning Müller
Definition: CQInvertedFile.h:358
This class captures the structure of an XML element.
Definition: CXMLElement.h:51
void buildQueryHash(CRelevanceLevelList &inQuery, CWeightingFunctionPointerHash &outQueryFeatureWeighters) const
creates a list of all the features which are in one or more of the query images should be replaced by...
double FeatureListToScore(TID inDID, const CDocumentFrequencyList &inFeatureList, const CWeightingFunctionPointerHash &inQuery) const
Turns the featurelist of a document into a score.
A factory for weighting functions with associated normalizers.
Definition: CQInvertedFile.h:74
A list of Document Frequency Elements (the main part of an inverted file)
Definition: CDocumentFrequencyList.h:58
CRELEVANCELEVEL.
Definition: CRelevanceLevel.h:60
int mModulo
You can choose to use only every lModulo-th feature.
Definition: CQInvertedFile.h:104
The Query manager for Queries on inverted Files.
Definition: CQInvertedFile.h:96
void releaseFeaturePruning()
set the variables back to its normal status
CSelfDestroyPointer< CWeighter > mWeighter
The weighter currently used.
Definition: CQInvertedFile.h:115
CWeighter & getWeighter()
For FerDeLance queries.
Definition: CScoreBoard.h:60
void unblockFeatureGroup(const int featureNumber)
unblockFeatureGroup - this releases the blocking of one feature group
double keepScorePruning(CScoreBoard &inoutScoreBoard, const CWeightingFunctionPointerList &inFeatures, bool inPositive, int inDesiredNumberOfDocuments) const
calculates the results for the images using some sort of pruning
An algorithm is a CXMLElement which is linked to a CSessionManager together they are able to build CQ...
Definition: CAlgorithm.h:43
void finishInit()
finish the initialisation phase make the weighting function know who its normalizers are ...
The Query manager for Queries on inverted Files.
Definition: CQuery.h:73
An accessor to an inverted file.
Definition: CAcInvertedFile.h:83
~CQInvertedFile()
destructor
virtual bool setAlgorithm(CAlgorithm &inAlgorithm)
set the Algorithm.
void useScoreBoardPruning(double inCutAfterFraction, double inReduceToFactor)
creates one entry in the scoreboardPruning
void releaseScoreBoardPruning()
releases all the settings for the ScorboardPruning
parameterPruningType mScoreBoardPruningArray[MAX_SCOREBOARD_PRUNINGS]
Henning Müller
Definition: CQInvertedFile.h:356
void useTimePruning(double inTimeCutoffPoint)
activates the time pruning with the give cuOffPoint
Definition: CRelevanceLevelList.h:48
This is in fact a collection of collections.
Definition: CAccessorAdminCollection.h:39
CWeighterFactory mWeighterFactory
This is a factory for weighters.
Definition: CQInvertedFile.h:111
void buildNormalizedQueryHash(double inPositiveRelevanceSum, double inNegativeRelevanceSum, CWeightingFunctionPointerHash &inQFW) const
Building a list of normalized WF from a hash of Weighting functions.
CWeighter * newWeighter(const string &inID) const
clones a weighter from the factory and sets the pointers in a way, that normalizers etc...
void init()
Initializer, used by both construcors.
void useFeaturePruning(double percentage)
activates the feature pruning with evaluating a certain percentage of the features ...
A weighter is a set of WeightingFunction and normalizers which are going to be used together...
Definition: CWeighter.h:41
double reduceTo
reduce the scoreboard to a factor of the number of images you want to retrieve
Definition: CQInvertedFile.h:352
double mPercentageofFeatures
Henning Müller
Definition: CQInvertedFile.h:363
bool mScoreBoardPruningUsed
true if the scoreboardis Pruned
Definition: CQInvertedFile.h:338
void releaseEvaluateAfterPruning()
releases the evaluation after the scoreboard pruning
bool isBlocked(const int featureNumber) const
isBlocked - returns true if the feature is blocked and false if not
double stopAfterFeature
this marks a fraction of the number of features used
Definition: CQInvertedFile.h:347
virtual CIDRelevanceLevelPairList * fastQuery(const CXMLElement &inQuery, int inNumberOfInterestingImages, double inDifferenceToBest)
a query which returns ID/RelevanceLevel pairs instead of instead of URL/RelevanceLevel pairs; this is...
virtual CIDRelevanceLevelPairList * fastQueryByFeature(const CWeightingFunctionPointerList &inQuery, int inNumberOfInterestingImages, double inDifferenceToBest)
Assuming that a correct CWeightingFunctionPointerHash has been built by fastQuery (or another functio...
bool mPruningUsed
Shows if any pruning is used.
Definition: CQInvertedFile.h:334
void useEvaluateAfterPruning()
activates the evaluation after the scoreboardPruning
Parameters for scoreboard pruning.
Definition: CQInvertedFile.h:343
void blockFeatureGroup(const int featureNumber)
blockFeatureGroup - this blocks one special group of features
double keepScore(CScoreBoard &inoutScoreBoard, const CWeightingFunctionPointerList &inFeatures, bool lPositive) const
calculates the score for all the images based on a list of features
void releaseTimePruning()
releases the timePruning
A hash of weighting function pointers.
Definition: CWeightingFunctionPointerHash.h:59