use of edu.cmu.minorthird.classify.Feature in project lucida by claritylab.
the class ScoreNormalizationFilter method addMaxScoreFeature.
/**
* Adds the maximum score of all factoid answers from the same extractor as
* a feature to the instance.
*/
private static void addMaxScoreFeature(MutableInstance instance, Result result, Result[] results) {
// calculate maximum score
double maxScore = 0;
// String extractor = result.getExtractionTechniques()[0];
for (Result r : results) if (r.getScore() > 0 && r.getScore() < Float.POSITIVE_INFINITY)
// if (r.extractedWith(extractor))
maxScore = Math.max(r.getScore(), maxScore);
Feature feature = new Feature(MAX_SCORE_F);
instance.addNumeric(feature, maxScore);
}
use of edu.cmu.minorthird.classify.Feature in project lucida by claritylab.
the class ScoreNormalizationFilter method addScoreFeature.
/**
* Adds the score of the answer candidate as a feature to the instance.
*/
private static void addScoreFeature(MutableInstance instance, Result result) {
float score = result.getScore();
Feature feature = new Feature(SCORE_F);
instance.addNumeric(feature, score);
}
use of edu.cmu.minorthird.classify.Feature in project lucida by claritylab.
the class ScoreNormalizationFilter method addMeanScoreFeature.
/**
* Adds the mean score of all factoid answers from the same extractor as a
* feature to the instance.
*/
private static void addMeanScoreFeature(MutableInstance instance, Result result, Result[] results) {
// calculate mean score
double meanScore = 0;
int numFactoid = 0;
// String extractor = result.getExtractionTechniques()[0];
for (Result r : results) if (r.getScore() > 0 && r.getScore() < Float.POSITIVE_INFINITY) {
// if (r.extractedWith(extractor)) {
meanScore += r.getScore();
numFactoid++;
// }
}
meanScore /= numFactoid;
Feature feature = new Feature(MEAN_SCORE_F);
instance.addNumeric(feature, meanScore);
}
use of edu.cmu.minorthird.classify.Feature in project lucida by claritylab.
the class ScoreNormalizationFilter method addNumAnswersFeature.
/**
* Adds the number of factoid answers from the same extractor as a feature
* to the instance.
*/
private static void addNumAnswersFeature(MutableInstance instance, Result result, Result[] results) {
// get number of factoid answers
int numFactoid = 0;
// String extractor = result.getExtractionTechniques()[0];
for (Result r : results) if (r.getScore() > 0 && r.getScore() < Float.POSITIVE_INFINITY)
// if (r.extractedWith(extractor))
numFactoid++;
Feature feature = new Feature(NUM_ANSWERS_F);
instance.addNumeric(feature, numFactoid);
}
use of edu.cmu.minorthird.classify.Feature in project lucida by claritylab.
the class ScoreNormalizationFilter method addExtractorFeature.
/**
* Adds the extractor used to obtain the answer candidate as a feature to
* the instance.
*/
private static void addExtractorFeature(MutableInstance instance, Result result) {
String extractor = result.getExtractionTechniques()[0];
Feature feature = new Feature(extractor);
instance.addBinary(feature);
}
Aggregations