00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _RETRIEVALPARAMETER_HPP
00013 #define _RETRIEVALPARAMETER_HPP
00014
00016 #include "Param.hpp"
00017
00018 #include "TFIDFRetMethod.hpp"
00019 #include "OkapiRetMethod.hpp"
00020 #include "SimpleKLRetMethod.hpp"
00021 #include "CORIRetMethod.hpp"
00022 #include "CosSimRetMethod.hpp"
00023 #include "InQueryRetMethod.hpp"
00024
00026 namespace RetrievalParameter {
00027
00029
00030
00031 static String databaseIndex;
00033 static String textQuerySet;
00035 static String resultFile;
00037 static int fbDocCount;
00039 static int resultCount;
00041
00042 static void get() {
00043 databaseIndex = ParamGetString("index","");
00044 textQuerySet = ParamGetString("textQuery","");
00045 resultFile = ParamGetString("resultFile","");
00046 fbDocCount = ParamGetInt("feedbackDocCount",0);
00047 resultCount = ParamGetInt("resultCount", 1000);
00048
00049 }
00050 };
00051
00052
00053 namespace TFIDFParameter {
00054
00056
00057 static WeightParam docTFPrm;
00058 static WeightParam qryTFPrm;
00059 static FeedbackParam fbPrm;
00061
00062 static void get()
00063 {
00064
00065 docTFPrm.tf = (TFMethod)ParamGetInt("doc.tfMethod",BM25);
00066 docTFPrm.bm25K1 = ParamGetDouble("doc.bm25K1",defaultDocK1);
00067 docTFPrm.bm25B = ParamGetDouble("doc.bm25B",defaultDocB);
00068
00069 qryTFPrm.tf = (TFMethod)ParamGetInt("query.tfMethod",BM25);
00070 qryTFPrm.bm25K1 = ParamGetDouble("query.bm25K1",defaultQryK1);
00071 qryTFPrm.bm25B = defaultQryB;
00072
00073 fbPrm.howManyTerms = ParamGetInt("feedbackTermCount",defaultHowManyTerms);
00074 fbPrm.posCoeff = ParamGetDouble("feedbackPosCoeff", defaultPosCoeff);
00075
00076 }
00077
00078 };
00079
00080 namespace OkapiParameter {
00081
00083
00084 static TFParam tfPrm;
00085 static FeedbackParam fbPrm;
00087
00088
00089 static void get()
00090 {
00091 tfPrm.k1 = ParamGetDouble("BM25K1",defaultK1);
00092 tfPrm.b = ParamGetDouble("BM25B",defaultB);
00093 tfPrm.k3 = ParamGetDouble("BM25K3", defaultK3);
00094 fbPrm.expQTF = ParamGetDouble("BM25QTF", defaultExpQTF);
00095 fbPrm.howManyTerms = ParamGetInt("feedbackTermCount",defaultHowManyTerms);
00096
00097 }
00098 };
00099
00100 namespace SimpleKLParameter {
00102
00103 static SimpleKLParameter::DocSmoothParam docPrm;
00104 static SimpleKLParameter::QueryModelParam qryPrm;
00105 static String smoothSupportFile;
00107
00108
00109 static void get()
00110 {
00111
00112 smoothSupportFile = ParamGetString("smoothSupportFile");
00113
00114 docPrm.smthMethod = (SmoothMethod) ParamGetInt("smoothMethod", DIRICHLETPRIOR);
00115 docPrm.smthStrategy= (SmoothStrategy) ParamGetInt("smoothStrategy", INTERPOLATE);
00116 docPrm.ADDelta = ParamGetDouble("discountDelta",defaultADDelta);
00117 docPrm.JMLambda = ParamGetDouble("JelinekMercerLambda",defaultJMLambda);
00118 docPrm.DirPrior = ParamGetDouble("DirichletPrior",defaultDirPrior);
00119
00120 qryPrm.fbMethod = (QueryUpdateMethod)ParamGetInt("queryUpdateMethod",MIXTURE);
00121 qryPrm.fbCoeff = ParamGetDouble("feedbackCoefficient",defaultFBCoeff);
00122 qryPrm.fbPrTh = ParamGetDouble("feedbackProbThresh",defaultFBPrTh);
00123 qryPrm.fbPrSumTh = ParamGetDouble("feedbackProbSumThresh",defaultFBPrSumTh);
00124 qryPrm.fbTermCount = ParamGetInt("feedbackTermCount",defaultFBTermCount);
00125 qryPrm.fbMixtureNoise = ParamGetDouble("feedbackMixtureNoise",defaultFBMixNoise);
00126 qryPrm.emIterations = ParamGetInt("emIterations",defaultEMIterations);
00127
00128 }
00129 };
00130
00131 namespace CORIParameter {
00132 static String collectionCounts;
00133 static double cstffactor;
00134 static double cstfbaseline;
00135 static double doctffactor;
00136 static double doctfbaseline;
00137 static void get() {
00138 collectionCounts = ParamGetString("collCounts", "USE_INDEX_COUNTS");
00139 cstffactor = ParamGetDouble("CSCTF_factor", 150);
00140 cstfbaseline = ParamGetDouble("CSCTF_baseline", 50);
00141 doctffactor = ParamGetDouble("DOCCTF_factor", 1.5);
00142 doctfbaseline = ParamGetDouble("DOCCTF_baseline", 0.5);
00143 }
00144 };
00145
00146 namespace CosSimParameter {
00147
00149
00150 static FeedbackParam fbPrm;
00151 static String L2NormFile;
00153
00154 static void get()
00155 {
00156 fbPrm.howManyTerms = ParamGetInt("feedbackTermCount",defaultHowManyTerms);
00157 fbPrm.posCoeff = ParamGetDouble("feedbackPosCoeff", defaultPosCoeff);
00158 L2NormFile = ParamGetString("L2File", defaultL2File);
00159 }
00160 };
00161
00162 namespace InQueryParameter {
00165 static double fbCoeff = 0.5;
00167 static int fbTermCount = 50;
00169 static double defaultBelief = 0.4;
00171 static bool cacheIDF = false;
00172 static void get()
00173 {
00174 defaultBelief = ParamGetDouble("defaultBelief", defaultBelief);
00175 fbCoeff = ParamGetDouble("feedbackPosCoeff", fbCoeff);
00176 fbTermCount = ParamGetInt("feedbackTermCount", fbTermCount);
00177 cacheIDF = (ParamGetInt("cacheIDF", cacheIDF) == 1);
00178 }
00179 };
00180
00181 #endif