/** * Predict an outcome given a set of features. By default, this simply * delegates to the object's <code>classifier</code>. Subclasses may override * this method to implement more complex classification procedures. * * @param features * The features to be classified. * @return The predicted outcome (label) for the features. */ protected Double classify(List<Feature> features) throws CleartkProcessingException { return this.classifier.classify(features); }
public Instance(OUTCOME_TYPE outcome, Collection<Feature> features) { this(outcome); addAll(features); }
public static Feature createFeature(String namePrefix, Feature feature) { return new Feature(createName(namePrefix, feature.name), feature.value); }
public boolean encodes(Feature feature) { return feature.getValue() instanceof Number; }
protected List<OUTCOME_TYPE> classify(List<Instance<OUTCOME_TYPE>> instances) throws CleartkProcessingException { List<List<Feature>> instanceFeatures = new ArrayList<List<Feature>>(); for (Instance<OUTCOME_TYPE> instance : instances) { instanceFeatures.add(instance.getFeatures()); } return this.classifier.classify(instanceFeatures); }
public SubCategorizationExtractor(String name) { this.featureName = Feature.createName(name, "SubCategorization"); }
public static CleartkProcessingException noInstanceOutcome(List<?> features) { String key = KEY_PREFIX + "noInstanceOutcome"; return new CleartkProcessingException(DEFAULT_RESOURCE_BUNDLE, key, features); }
@Override public void collectionProcessComplete() throws AnalysisEngineProcessException { super.collectionProcessComplete(); if (isTraining()) { dataWriter.finish(); } }
@Override public void collectionProcessComplete() throws AnalysisEngineProcessException { super.collectionProcessComplete(); if (isTraining()) { dataWriter.finish(); } }
public boolean encodes(Feature feature) { return feature.getValue() instanceof Boolean; }
/** * Predict an outcome given a set of features. By default, this simply * delegates to the object's <code>classifier</code>. Subclasses may override * this method to implement more complex classification procedures. * * @param features * The features to be classified. * @return The predicted outcome (label) for the features. */ protected Double classify(List<Feature> features) throws CleartkProcessingException { return this.classifier.classify(features); }
public ContinuousBag(File vecFile, Context... contexts) throws FileNotFoundException { this.contexts = contexts; this.vectors = readVectorFile(vecFile); // String[] names = new String[contexts.length + 1]; // names[0] = "ContinuousBag"; // for (int i = 1; i < names.length; ++i) { // names[i] = contexts[i - 1].getName(); // } this.name = Feature.createName("ContinuousBag"); }
public Instance(Collection<Feature> features) { this(); addAll(features); }
/** * Predict an outcome given a set of features. By default, this simply * delegates to the object's <code>classifier</code>. Subclasses may override * this method to implement more complex classification procedures. * * @param features * The features to be classified. * @return The predicted outcome (label) for the features. */ protected String classify(List<Feature> features) throws CleartkProcessingException { return this.classifier.classify(features); }
/** * Predict an outcome given a set of features. By default, this simply * delegates to the object's <code>classifier</code>. Subclasses may override * this method to implement more complex classification procedures. * * @param features * The features to be classified. * @return The predicted outcome (label) for the features. */ protected String classify(List<Feature> features) throws CleartkProcessingException { return this.classifier.classify(features); }
/** * Predict an outcome given a set of features. By default, this simply * delegates to the object's <code>classifier</code>. Subclasses may override * this method to implement more complex classification procedures. * * @param features * The features to be classified. * @return The predicted outcome (label) for the features. */ protected String classify(List<Feature> features) throws CleartkProcessingException { return this.classifier.classify(features); }
/** * Predict an outcome given a set of features. By default, this simply * delegates to the object's <code>classifier</code>. Subclasses may override * this method to implement more complex classification procedures. * * @param features * The features to be classified. * @return The predicted outcome (label) for the features. */ protected String classify(List<Feature> features) throws CleartkProcessingException { return this.classifier.classify(features); }