/** * Contructs an instance of the TRECResultsMatching given an index. * @param _index * @throws IOException */ public TRECResultsMatching(Index _index) throws IOException { this(_index, ApplicationSetup.getProperty("matching.trecresults.file", ""), ApplicationSetup.getProperty("matching.dsms", "")); } /**
/** * Contructs an instance of the TRECResultsMatching. * @param _index * @param _filename * @throws IOException */ public TRECResultsMatching(Index _index, String _filename) throws IOException { this(_index, _filename, ApplicationSetup.getProperty("matching.dsms", "")); } /**
/** * Initialises the Rocchio's beta for query expansion. */ public void initialise() { /* Accept both rocchio.beta and rocchio_beta as property name. rocchio_beta will deprecated in due course. */ ROCCHIO_BETA = Double.parseDouble(ApplicationSetup.getProperty("rocchio.beta", ApplicationSetup.getProperty("rocchio_beta", "0.4d"))); PARAMETER_FREE = Boolean.parseBoolean(ApplicationSetup.getProperty("parameter.free.expansion", "true")); }
public AbstractQuerying(String _appName) { super(); this.appName = _appName; String wModel = ApplicationSetup.getProperty(appName +".model", null); if (wModel != null) controls.put(SearchRequest.CONTROL_WMODEL, wModel); }
protected void initialise_parameters() { modifiedLength = Integer.parseInt(ApplicationSetup.getProperty("ssa.modified.length","1000")); w = Double.parseDouble(ApplicationSetup.getProperty("ssa.w","1")); } /** {@inheritDoc}*/@Override
public FatScoringMatching(Index _index, Matching _parent) { super(_index, _parent, ApplicationSetup.getProperty("fat.scoring.matching.model", ApplicationSetup.getProperty("trec.model", "BM25")).equals("FromMQT") ? null : WeightingModelFactory.newInstance( ApplicationSetup.getProperty("fat.scoring.matching.model", ApplicationSetup.getProperty("trec.model", "BM25")) ) ); }
protected void initialise(MatchingQueryTerms queryTerms) { //System.gc(); updateStartTime(System.currentTimeMillis()); RETRIEVED_SET_SIZE = Integer.parseInt(ApplicationSetup.getProperty("matching.retrieved_set_size", "1000")); IGNORE_LOW_IDF_TERMS = Boolean.parseBoolean(ApplicationSetup.getProperty("ignore.low.idf.terms","false")); MATCH_EMPTY_QUERY = Boolean.parseBoolean(ApplicationSetup.getProperty("match.empty.query","false")); this.numberOfRetrievedDocuments = 0; }
/** * {@inheritDoc} */ @Override public boolean modifyScores(Index index, MatchingQueryTerms terms, ResultSet set) { MU = Double.parseDouble(ApplicationSetup.getProperty("mrf.mu", ApplicationSetup.getProperty("proximity.norm2.c", "4000d"))); return super.modifyScores(index, terms, set); }
public LabelDecorator() throws Exception { String filename = ApplicationSetup.getProperty("learning.labels.file", null); if (filename == null) throw new IllegalArgumentException("No qrels file specified in property learning.labels.file"); qrels = new TRECQrelsInMemory(filename); this.defLabel = ApplicationSetup.getProperty("learning.labels.default", "0"); }
/** load in the controls that user is allowed to set */ protected void load_controls_allowed() { /* load in the controls that user is allowed to set */ String allowed = ApplicationSetup.getProperty("querying.allowed.controls", "c,start,end").trim().toLowerCase(); String[] controls = allowed.split("\\s*,\\s*"); Allowed_Controls = new HashSet<String>(); for(String control : controls) { Allowed_Controls.add(control); } }
public FatResultsMatching (Index i) throws IOException { filename = ApplicationSetup.getProperty("fat.results.matching.file", null); maxResults = Integer.parseInt(ApplicationSetup.getProperty("fat.results.matching.max.results", "0")); if (filename == null) throw new IllegalArgumentException("fat.results.matching.file needs to be specified"); logger.info("Reading fat resultsets from " + filename); dis = new DataInputStream(Files.openFileStream(filename)); }
protected MetaIndexBuilder createMetaIndexBuilder() { final String[] forwardMetaKeys = ApplicationSetup.getProperty("indexer.meta.forward.keys", "docno").split("\\s*,\\s*"); final int[] metaKeyLengths = parseInts(ApplicationSetup.getProperty("indexer.meta.forward.keylens", "20").split("\\s*,\\s*")); final String[] reverseMetaKeys = ApplicationSetup.getProperty("indexer.meta.reverse.keys", "").split("\\s*,\\s*"); return new CompressingMetaIndexBuilder(currentIndex, forwardMetaKeys, metaKeyLengths, reverseMetaKeys); }
/** Obtain an instance of GammaFunction */ public static final GammaFunction getGammaFunction() { String className = ApplicationSetup.getProperty("gamma.function", WikipediaLanczosGammaFunction.class.getName()); try{ Class<? extends GammaFunction> clz = ApplicationSetup.getClass(className).asSubclass(GammaFunction.class); return DEBUG ? new DebugGammaFunction(clz.newInstance()) : clz.newInstance(); } catch (Exception e) { throw new IllegalArgumentException(e); } }
/** * default constructor */ public RelevanceFeedbackSelectorDocids() { String feedbackFilename = ApplicationSetup.getProperty("qe.feedback.filename", ApplicationSetup.TERRIER_ETC+ ApplicationSetup.FILE_SEPARATOR+"feedback"); this.loadRelevanceInformation(feedbackFilename); } /**
/** * Construct a SimpleXMLCollection */ public SimpleXMLCollection() { this(ApplicationSetup.COLLECTION_SPEC, ApplicationSetup.makeAbsolute( ApplicationSetup.getProperty("xml.blacklist.docids", ""), ApplicationSetup.TERRIER_ETC)); }
/** set a property value only if it has not already been set * @param propertyKey the name of the property to set. * @param defaultValue the value of the property to set. */ public static void setDefaultProperty(String propertyKey, String defaultValue) { if (getProperty(propertyKey,null) != null) setProperty(propertyKey, defaultValue); }
/** load in the term pipeline */ protected void load_pipeline() { final String[] pipes = ApplicationSetup.getProperty( "termpipelines", "Stopwords,PorterStemmer").trim() .split("\\s*,\\s*"); synchronized (this) { tpa = new BaseTermPipelineAccessor(pipes); } }
/** Returns the weighting model requested by the Request from * the WeightingModel factory. * @param rq The name of the weighting model to instantiate */ protected static Model getWeightingModel(Request rq) { String wmodel = rq.getControl(CONTROL_WMODEL, ApplicationSetup.getProperty("trec.model", "DPH")); return WeightingModelFactory.newInstance(wmodel, rq.getIndex()); }
public void intialise() { this.createManager(); super.matchopQl = Boolean.parseBoolean(ApplicationSetup.getProperty("trec.topics.matchopql", "false")); this.querySource = this.getQueryParser(); this.printer = getOutputFormat(); this.resultsCache = getResultsCache(); }
public void intialise() { this.createManager(); super.matchopQl = Boolean.parseBoolean(ApplicationSetup.getProperty("trec.topics.matchopql", "false")); this.querySource = this.getQueryParser(); this.printer = getOutputFormat(); this.resultsCache = getResultsCache(); }