本文整理汇总了Java中edu.cmu.meteor.scorer.MeteorScorer类的典型用法代码示例。如果您正苦于以下问题:Java MeteorScorer类的具体用法?Java MeteorScorer怎么用?Java MeteorScorer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MeteorScorer类属于edu.cmu.meteor.scorer包,在下文中一共展示了MeteorScorer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rescore
import edu.cmu.meteor.scorer.MeteorScorer; //导入依赖的package包/类
private static void rescore(int param, boolean spearman) {
// Rescore if all weights specified
if (param == step.size()) {
ArrayList<Double> p = new ArrayList<Double>();
p.add(weights.get(0));
p.add(weights.get(1));
p.add(weights.get(2));
p.add(weights.get(3));
ArrayList<Double> w = new ArrayList<Double>();
w.add(weights.get(4));
w.add(weights.get(5));
w.add(weights.get(6));
w.add(weights.get(7));
config.setParameters(p);
config.setModuleWeights(w);
MeteorScorer scorer = new MeteorScorer(config);
ArrayList<Double> meteorScore = new ArrayList<Double>();
for (int seg = 0; seg < statsList.size(); seg++) {
MeteorStats stats = statsList.get(seg);
scorer.computeMetrics(stats);
meteorScore.add(stats.score);
}
double correlation = spearman ? spearman(meteorScore, terList)
: pearsonWeighted(meteorScore, terList, lengthList);
out.print(correlation);
for (Double n : weights)
out.print(" " + df.format(n));
out.println();
return;
}
for (double n = initialWeights.get(param); n <= finalWeights.get(param); n += step
.get(param)) {
weights.set(param, n);
rescore(param + 1, spearman);
}
}
示例2: rerank
import edu.cmu.meteor.scorer.MeteorScorer; //导入依赖的package包/类
private static void rerank(int param) {
// Rescore if all weights specified
if (param == step.size()) {
ArrayList<Double> p = new ArrayList<Double>();
p.add(weights.get(0));
p.add(weights.get(1));
p.add(weights.get(2));
p.add(weights.get(3));
ArrayList<Double> w = new ArrayList<Double>();
w.add(weights.get(4));
w.add(weights.get(5));
w.add(weights.get(6));
w.add(weights.get(7));
config.setParameters(p);
config.setModuleWeights(w);
MeteorScorer scorer = new MeteorScorer(config);
ArrayList<Double> meteorScore = new ArrayList<Double>();
for (int seg = 0; seg < statsList.size(); seg++) {
MeteorStats stats = statsList.get(seg);
scorer.computeMetrics(stats);
meteorScore.add(stats.score);
}
double consist = kendall(meteorScore);
out.print(consist);
for (Double n : weights)
out.print(" " + df.format(n));
out.println();
return;
}
for (double n = initialWeights.get(param); n <= finalWeights.get(param); n += step
.get(param)) {
weights.set(param, n);
rerank(param + 1);
}
}