00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00014 #include "Param.hpp"
00015
00016 #include "TFIDFRetMethod.hpp"
00017 #include "OkapiRetMethod.hpp"
00018 #include "SimpleKLRetMethod.hpp"
00019
00020
00022 namespace RetrievalParameter {
00023
00025
00026
00027 static String databaseIndex;
00029 static String textQuerySet;
00031 static String resultFile;
00033 static int fbDocCount;
00035 static int resultCount;
00037
00038 void get() {
00039 databaseIndex = ParamGetString("index","");
00040 textQuerySet = ParamGetString("textQuery","");
00041 resultFile = ParamGetString("resultFile","");
00042 fbDocCount = ParamGetInt("feedbackDocCount",0);
00043 resultCount = ParamGetInt("resultCount", 1000);
00044 }
00045 };
00046
00047
00048 namespace TFIDFParameter {
00049
00051
00052 static WeightParam docTFPrm;
00053 static WeightParam qryTFPrm;
00054 static FeedbackParam fbPrm;
00056
00057 static void get()
00058 {
00059
00060 docTFPrm.tf = (TFMethod)ParamGetInt("doc.tfMethod",BM25);
00061 docTFPrm.bm25K1 = ParamGetDouble("doc.bm25K1",defaultDocK1);
00062 docTFPrm.bm25B = ParamGetDouble("doc.bm25B",defaultDocB);
00063
00064 qryTFPrm.tf = (TFMethod)ParamGetInt("query.tfMethod",BM25);
00065 qryTFPrm.bm25K1 = ParamGetDouble("query.bm25K1",defaultQryK1);
00066 qryTFPrm.bm25B = defaultQryB;
00067
00068 fbPrm.howManyTerms = ParamGetInt("feedbackTermCount",defaultHowManyTerms);
00069 fbPrm.posCoeff = ParamGetDouble("feedbackPosCoeff", defaultPosCoeff);
00070
00071 }
00072
00073 };
00074
00075 namespace OkapiParameter {
00076
00078
00079 static TFParam tfPrm;
00080 static FeedbackParam fbPrm;
00082
00083
00084 static void get()
00085 {
00086 tfPrm.k1 = ParamGetDouble("BM25K1",defaultK1);
00087 tfPrm.b = ParamGetDouble("BM25B",defaultB);
00088 tfPrm.k3 = ParamGetDouble("BM25K3", defaultK3);
00089 fbPrm.expQTF = ParamGetDouble("BM25QTF", defaultExpQTF);
00090 fbPrm.howManyTerms = ParamGetInt("feedbackTermCount",defaultHowManyTerms);
00091
00092 }
00093 };
00094
00095 namespace SimpleKLParameter {
00097
00098 static SimpleKLParameter::DocSmoothParam docPrm;
00099 static SimpleKLParameter::QueryModelParam qryPrm;
00100 static String smoothSupportFile;
00102
00103
00104 static void get()
00105 {
00106
00107 smoothSupportFile = ParamGetString("smoothSupportFile");
00108
00109 docPrm.smthMethod = (SmoothMethod) ParamGetInt("smoothMethod", DIRICHLETPRIOR);
00110 docPrm.smthStrategy= (SmoothStrategy) ParamGetInt("smoothStrategy", INTERPOLATE);
00111 docPrm.ADDelta = ParamGetDouble("discountDelta",defaultADDelta);
00112 docPrm.JMLambda = ParamGetDouble("JelinekMercerLambda",defaultJMLambda);
00113 docPrm.DirPrior = ParamGetDouble("DirichletPrior",defaultDirPrior);
00114
00115 qryPrm.fbMethod = (QueryUpdateMethod)ParamGetInt("queryUpdateMethod",MIXTURE);
00116 qryPrm.fbCoeff = ParamGetDouble("feedbackCoefficient",defaultFBCoeff);
00117 qryPrm.fbPrTh = ParamGetDouble("feedbackProbThresh",defaultFBPrTh);
00118 qryPrm.fbPrSumTh = ParamGetDouble("feedbackProbSumThresh",defaultFBPrSumTh);
00119 qryPrm.fbTermCount = ParamGetInt("feedbackTermCount",defaultFBTermCount);
00120 qryPrm.fbMixtureNoise = ParamGetDouble("feedbackMixtureNoise",defaultFBMixNoise);
00121 qryPrm.emIterations = ParamGetInt("emIterations",defaultEMIterations);
00122
00123 }
00124 }
00125
00126
00127
00128
00129
00130
00131
00132
00133