当前位置: 首页>>代码示例>>Java>>正文


Java MeteorScorer.computeMetrics方法代码示例

本文整理汇总了Java中edu.cmu.meteor.scorer.MeteorScorer.computeMetrics方法的典型用法代码示例。如果您正苦于以下问题:Java MeteorScorer.computeMetrics方法的具体用法?Java MeteorScorer.computeMetrics怎么用?Java MeteorScorer.computeMetrics使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.cmu.meteor.scorer.MeteorScorer的用法示例。


在下文中一共展示了MeteorScorer.computeMetrics方法的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);
	}
}
 
开发者ID:cservan,项目名称:METEOR-E,代码行数:46,代码来源:Trainer.java

示例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);
	}
}
 
开发者ID:cservan,项目名称:METEOR-E,代码行数:45,代码来源:Trainer.java


注:本文中的edu.cmu.meteor.scorer.MeteorScorer.computeMetrics方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。