本文整理汇总了Java中com.amazonaws.mturk.requester.RequesterStatistic.NumberPluralityAnswersCorrect方法的典型用法代码示例。如果您正苦于以下问题:Java RequesterStatistic.NumberPluralityAnswersCorrect方法的具体用法?Java RequesterStatistic.NumberPluralityAnswersCorrect怎么用?Java RequesterStatistic.NumberPluralityAnswersCorrect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amazonaws.mturk.requester.RequesterStatistic
的用法示例。
在下文中一共展示了RequesterStatistic.NumberPluralityAnswersCorrect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printReviewResults
import com.amazonaws.mturk.requester.RequesterStatistic; //导入方法依赖的package包/类
/**
* Fetches and prints a bunch of review policy info about the given HIT.
* @param hitId Which HIT to print results for
*/
public void printReviewResults(String hitId) {
service.getRequesterStatistic(RequesterStatistic.EstimatedTotalLiability, TimePeriod.LifeToDate, null);
System.out.println("Getting review policy results for HIT " + hitId + "...");
System.out.println();
GetReviewResultsForHITResult results = service.getReviewResultsForHIT(
hitId,
new ReviewPolicyLevel[] {ReviewPolicyLevel.Assignment, ReviewPolicyLevel.HIT},
true, // retrieveActions
true, // retrieveResults
1, // pageNumber
1000, // pageSize
null); // responseGroup
// Print ScoreKnownAnswers results/actions for this HIT
printReviewReport(results.getAssignmentReviewReport(), results.getAssignmentReviewPolicy().getPolicyName());
// Print PluralityHitReview results/actions for this HIT
printReviewReport(results.getHITReviewReport(), results.getHITReviewPolicy().getPolicyName());
// Get a list of workers who worked on this HIT
Assignment[] assignments = service.getAssignmentsForHIT(hitId, 1);
Set<String> workerIds = new HashSet<String>();
if (assignments != null) {
for (Assignment assignment : assignments) {
workerIds.add(assignment.getWorkerId());
}
}
// For each of those workers, fetch statistics relevant to review policies
RequesterStatistic[] statistics = { // which statistics to print
RequesterStatistic.NumberKnownAnswersCorrect,
RequesterStatistic.NumberKnownAnswersIncorrect,
RequesterStatistic.NumberKnownAnswersEvaluated,
RequesterStatistic.PercentKnownAnswersCorrect,
RequesterStatistic.NumberPluralityAnswersCorrect,
RequesterStatistic.NumberPluralityAnswersIncorrect,
RequesterStatistic.NumberPluralityAnswersEvaluated,
RequesterStatistic.PercentPluralityAnswersCorrect
};
if (workerIds.size() == 0) {
System.out.println("No workers worked on this HIT.");
} else {
System.out.println("Review-policy-related statistics follow.");
System.out.println("These statistics are life-to-date counts for each worker who worked on this HIT.");
System.out.println("These counts only include work done for the requester of the HIT.");
for (String workerId : workerIds) {
System.out.println("Worker " + workerId + ":");
for (RequesterStatistic statistic : statistics) {
System.out.println("- " + statistic.getValue() + ": " + getStatistic(workerId, statistic));
}
}
}
}