ElementFeatureScoringTask(int threadID, ImmutableIterator<ElementFeatureJointCounts> iterator, ElementFeatureCountStorage elementFeaturecounts, PersistenceDevice elementFeatureScoreDevice, PersistenceDevice elementScoreDevice) throws CreationException, ConfigurationException { this.threadID = threadID; this.iterator = iterator; this.elementFeaturecounts = elementFeaturecounts; this.elementFeatureScoreDevice = elementFeatureScoreDevice; this.elementScoreDevice = elementScoreDevice; featureScoring = (FeatureScoring)Factory.create(scorerParams.get(Configuration.FEATURE_SCORING_CLASS), scorerParams); elementScoring = (ElementScoring)Factory.create(scorerParams.get(Configuration.ELEMENT_SCORING_CLASS), scorerParams); ConfigurationParams commonFeatureCriterionParams = scorerParams.getSisterModuleConfiguration(Configuration.COMMON_FEATURE_CRITERION); commonFeatureCriterion = (CommonFeatureCriterion)Factory.create(commonFeatureCriterionParams.get(Configuration.CLASS), commonFeatureCriterionParams); ConfigurationParams vectorTruncaterParams = scorerParams.getSisterModuleConfiguration(Configuration.VECTOR_TRUNCATE); vectorTruncater = (VectorTruncate)Factory.create(vectorTruncaterParams.get(Configuration.CLASS), vectorTruncaterParams); }
protected void initElementStorage(ConfigurationParams params) { try { DataStructureFactory dataStructureFactory = new ConfigurationBasedDataStructureFactory(params.getConfigurationFile()); CountableIdentifiableStorage<Element> elementStorage = dataStructureFactory.createElementsDataStucture(); ConfigurationParams elementDeviceParams = params.getSisterModuleConfiguration(Configuration.ELEMENTS_STORAGE_DEVICE); PersistenceDevice elementsDevice = (PersistenceDevice)Factory.create(elementDeviceParams.get(Configuration.CLASS), elementDeviceParams); elementsDevice.open(); elementStorage.loadState(elementsDevice); irelevavtElementsForSimilarityCalculation = new TIntHashSet(); ImmutableIterator<Element> it = elementStorage.iterator(); while (it.hasNext()) { Element element = it.next(); if (element.getData().toString().endsWith(REV_PRED)) irelevavtElementsForSimilarityCalculation.add(element.getID()); } //debug /*System.out.println("irelevavtElementsForSimilarityCalculation" + irelevavtElementsForSimilarityCalculation.size()); TIntIterator tmpit = irelevavtElementsForSimilarityCalculation.iterator(); while (tmpit.hasNext()) System.out.print("\t" + tmpit.next()); System.out.print("\n");*/ } catch (Exception e) { logger.info("No element storage is used for determining relevant elements for similarity calculation [" + e.toString() +"]"); } } /* (non-Javadoc)
ConfigurationParams vectorTruncaterParams = null; try { vectorTruncaterParams = similarityCalculatorParams.getSisterModuleConfiguration(Configuration.VECTOR_TRUNCATE); } catch (ConfigurationException e) { logger.info("no vector truncter was defined: " + e);