Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: CoveringPhraseCavGenerator in generate function #5

Open
noyessie opened this issue May 16, 2017 · 0 comments
Open

Bug: CoveringPhraseCavGenerator in generate function #5

noyessie opened this issue May 16, 2017 · 0 comments

Comments

@noyessie
Copy link

This bug appear when some candidate answer variant don't have head tokens. After the first stream pipeline,
Set<Token> heads = TypeUtil.getCandidateAnswerVariants(jcas).stream() .map(TypeUtil::getCandidateAnswerOccurrences).flatMap(Collection::stream) .map(TypeUtil::getHeadTokenOfAnnotation).collect(toSet());
one token is null ( only one because is a Set Collection).

After that, when you call Token::getHead in this part of code:
Set<Token> parents = heads.stream().map(Token::getHead).filter(t -> t != null) .filter(t -> !heads.contains(t)).collect(toSet());
A NullPointerException occur.

For solve this, i think you need to put a non null filter.

regard.

ziy added a commit to ziy/bioasq that referenced this issue May 16, 2017
@noyessie Does it make it working or not?
Also, please note that we found excluding this CoveringPhraseCavGenerator from the answer answer generation phrase might give you some improvement over the one that has all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant