/**
* Creates an {@code AnswerKey} where the same response may appear both as assessed and
* unassessed. This removes any such tuples from the unassessed set before calling {@link
* #from(com.bbn.bue.common.symbols.Symbol, Iterable, Iterable, CorefAnnotation)}. This is simply
* provided for convenience.
*/
public static AnswerKey fromPossiblyOverlapping(Symbol docID, Iterable<AssessedResponse> assessed,
Iterable<Response> unassessedResponses, CorefAnnotation corefAnnotation) {
final ImmutableSet<AssessedResponse> assessedResponsesSet = ImmutableSet.copyOf(assessed);
final ImmutableSet<Response> unassessedResponseSet = ImmutableSet.copyOf(unassessedResponses);
final Set<Response> assessedResponses = FluentIterable.from(assessedResponsesSet)
.transform(AssessedResponseFunctions.response()).toSet();
if (Sets.intersection(assessedResponses, unassessedResponseSet).isEmpty()) {
return from(docID, assessedResponsesSet, unassessedResponseSet, corefAnnotation);
} else {
return from(docID, assessedResponsesSet,
Sets.difference(unassessedResponseSet, assessedResponses),
corefAnnotation);
}
}
AnswerKey.java 文件源码
java
阅读 44
收藏 0
点赞 0
评论 0
项目:tac-kbp-eal
作者:
评论列表
文章目录