/** * Returns the requested weighting model. * @param name The name of the weighting model to instantiate. */ public static WeightingModel newInstance(String name) { return newInstance(name, null); }
/** * Returns the requested weighting model. * @param name The name of the weighting model to instantiate. */ public static WeightingModel newInstance(String name) { return newInstance(name, null); }
public SingleFieldModel(String[] parameters) throws Exception { this.params = parameters; this.basicModel = WeightingModelFactory.newInstance(parameters[0]); activeFieldIds = new int[parameters.length -1]; for(int i=1;i<parameters.length;i++) { activeFieldIds[i-1] = Integer.parseInt(parameters[i]); } }
public SingleFieldModel(String[] parameters) throws Exception { this.params = parameters; this.basicModel = WeightingModelFactory.newInstance(parameters[0]); activeFieldIds = new int[parameters.length -1]; for(int i=1;i<parameters.length;i++) { activeFieldIds[i-1] = Integer.parseInt(parameters[i]); } }
/** 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()); }
final WeightingModel wm = WeightingModelFactory.newInstance(qiName); _childrenQiModels.add(wm); _childrenQiNames.add(featureNames[i]); filter = filterOW; WeightingModel wm = WeightingModelFactory.newInstance(wModelName); AbstractScoringMatching fsm = scoringMatchingImpl .getConstructor(Index.class, Matching.class, WeightingModel.class, Predicate.class)
final WeightingModel wm = WeightingModelFactory.newInstance(qiName); _childrenQiModels.add(wm); _childrenQiNames.add(featureNames[i]); filter = filterOW; WeightingModel wm = WeightingModelFactory.newInstance(wModelName); AbstractScoringMatching fsm = scoringMatchingImpl .getConstructor(Index.class, Matching.class, WeightingModel.class, Predicate.class)
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")) ) ); }
/** 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 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")) ) ); }
@Test public void testCacheWorks() { WeightingModel m1 = WeightingModelFactory.newInstance("BM25"); WeightingModel m2 = WeightingModelFactory.newInstance("BM25"); assertTrue(m1 == m2); } }
@Test public void testGetBasicModels() { WeightingModel bm25 = WeightingModelFactory.newInstance("BM25"); assertTrue(bm25 instanceof BM25); WeightingModel pl2 = WeightingModelFactory.newInstance("PL2"); assertTrue(pl2 instanceof PL2); }
qt.getValue().termModels.add(WeightingModelFactory.newInstance(wmodelName));
qt.getValue().termModels.add(WeightingModelFactory.newInstance(wmodelName));
@Test public void testGetAdvancedModels() { WeightingModel m = WeightingModelFactory.newInstance("DFRWeightingModel(P,L,2)"); assertNotNull(m); assertTrue(m instanceof DFRWeightingModel); assertEquals("PL2c1.0", m.getInfo()); }