Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

RetParamManager.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2001 Carnegie Mellon University.  All Rights Reserved.
00003  *
00004  * Use of the Lemur Toolkit for Language Modeling and Information Retrieval
00005  * is subject to the terms of the software license set forth in the LICENSE
00006  * file included with this software, and also available at
00007  * http://www.cs.cmu.edu/~lemur/license.html
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 
00022 
00024 namespace RetrievalParameter {
00025 
00027 
00028 
00029   static String databaseIndex;
00031   static String textQuerySet;
00033   static String resultFile;
00035   static int fbDocCount;
00037   static int resultCount;
00039 
00040   static void get() {
00041     databaseIndex = ParamGetString("index","");
00042     textQuerySet = ParamGetString("textQuery","");
00043     resultFile = ParamGetString("resultFile","");
00044     fbDocCount = ParamGetInt("feedbackDocCount",0); // default being no feedback
00045     resultCount = ParamGetInt("resultCount", 1000); 
00046   }
00047 };
00048 
00049 
00050 namespace TFIDFParameter {
00051 
00053 
00054   static WeightParam docTFPrm;
00055   static WeightParam qryTFPrm;
00056   static FeedbackParam fbPrm;
00058   
00059   static void get()
00060   {
00061     
00062     docTFPrm.tf = (TFMethod)ParamGetInt("doc.tfMethod",BM25);
00063     docTFPrm.bm25K1 = ParamGetDouble("doc.bm25K1",defaultDocK1);
00064     docTFPrm.bm25B = ParamGetDouble("doc.bm25B",defaultDocB);
00065   
00066     qryTFPrm.tf = (TFMethod)ParamGetInt("query.tfMethod",BM25);
00067     qryTFPrm.bm25K1 = ParamGetDouble("query.bm25K1",defaultQryK1);
00068     qryTFPrm.bm25B = defaultQryB;
00069     
00070     fbPrm.howManyTerms = ParamGetInt("feedbackTermCount",defaultHowManyTerms); 
00071     fbPrm.posCoeff = ParamGetDouble("feedbackPosCoeff", defaultPosCoeff); 
00072     
00073   }
00074 
00075 };
00076 
00077 namespace OkapiParameter {
00078 
00080 
00081   static TFParam tfPrm;
00082   static FeedbackParam fbPrm;
00084 
00085 
00086   static void get()
00087   {
00088     tfPrm.k1 = ParamGetDouble("BM25K1",defaultK1);
00089     tfPrm.b =  ParamGetDouble("BM25B",defaultB);
00090     tfPrm.k3 = ParamGetDouble("BM25K3", defaultK3);
00091     fbPrm.expQTF = ParamGetDouble("BM25QTF", defaultExpQTF);
00092     fbPrm.howManyTerms = ParamGetInt("feedbackTermCount",defaultHowManyTerms);
00093     
00094   }
00095 };
00096 
00097 namespace SimpleKLParameter {
00099 
00100   static SimpleKLParameter::DocSmoothParam docPrm;
00101   static SimpleKLParameter::QueryModelParam qryPrm;
00102   static String smoothSupportFile;
00104 
00105 
00106   static void get()
00107   {
00108     
00109     smoothSupportFile = ParamGetString("smoothSupportFile");
00110     
00111     docPrm.smthMethod = (SmoothMethod) ParamGetInt("smoothMethod", DIRICHLETPRIOR);
00112     docPrm.smthStrategy= (SmoothStrategy) ParamGetInt("smoothStrategy", INTERPOLATE);
00113     docPrm.ADDelta = ParamGetDouble("discountDelta",defaultADDelta);
00114     docPrm.JMLambda = ParamGetDouble("JelinekMercerLambda",defaultJMLambda);
00115     docPrm.DirPrior = ParamGetDouble("DirichletPrior",defaultDirPrior);
00116     
00117     qryPrm.fbMethod = (QueryUpdateMethod)ParamGetInt("queryUpdateMethod",MIXTURE);
00118     qryPrm.fbCoeff = ParamGetDouble("feedbackCoefficient",defaultFBCoeff);
00119     qryPrm.fbPrTh = ParamGetDouble("feedbackProbThresh",defaultFBPrTh);
00120     qryPrm.fbPrSumTh = ParamGetDouble("feedbackProbSumThresh",defaultFBPrSumTh);
00121     qryPrm.fbTermCount = ParamGetInt("feedbackTermCount",defaultFBTermCount);
00122     qryPrm.fbMixtureNoise = ParamGetDouble("feedbackMixtureNoise",defaultFBMixNoise);
00123     qryPrm.emIterations = ParamGetInt("emIterations",defaultEMIterations);
00124                                               
00125   }
00126 }
00127 
00128 
00129 
00130 
00131 #endif

Generated at Fri Jul 26 18:22:27 2002 for LEMUR by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000