@Override public void read() throws IOException{ super.read(); ensemble.read(new File(getDataDir(), "ensemble").getAbsolutePath()); }
@Override public void read() throws IOException { inlink.read(); outlink.read(); super.read(); }
@Override public void read() throws IOException { super.read(); RandomProjectionKNNFinder knn = new RandomProjectionKNNFinder(articleFeatures); if (knn.load(new File(getDataDir(), "knn.bin"))) { accelerator = knn; } }
@Override public void read() throws IOException { super.read(); if (getFeatureMatrixPath().isFile() && getTransposeMatrixPath().isFile()) { IOUtils.closeQuietly(featureMatrix); IOUtils.closeQuietly(transposeMatrix); featureMatrix = new SparseMatrix(getFeatureMatrixPath()); transposeMatrix = new SparseMatrix(getTransposeMatrixPath()); similarity.setMatrices(featureMatrix, transposeMatrix, getDataDir()); } }
protected static void configureBase(Configurator configurator, BaseSRMetric sr, Config config) throws ConfigurationException { Config rootConfig = configurator.getConf().get(); File path = new File(rootConfig.getString("sr.metric.path")); sr.setDataDir(FileUtils.getFile(path, sr.getName(), sr.getLanguage().getLangCode())); // initialize normalizers sr.setSimilarityNormalizer(configurator.get(Normalizer.class, config.getString("similaritynormalizer"))); sr.setMostSimilarNormalizer(configurator.get(Normalizer.class, config.getString("mostsimilarnormalizer"))); boolean isTraining = rootConfig.getBoolean("sr.metric.training"); if (isTraining) { sr.setReadNormalizers(false); } if (config.hasPath("buildMostSimilarCache")) { sr.setBuildMostSimilarCache(config.getBoolean("buildMostSimilarCache")); } try { sr.read(); } catch (IOException e){ throw new ConfigurationException(e); } LOG.info("finished base configuration of metric " + sr.getName()); } }