Occasionally when the dependency parser is given a "bad" sentence, produces a
parse with only a TopDependencyNode that has a null pointer for its head
relations array. When it comes time to prepare the data for the Semantic Role
Labeler, this causes a null pointer exception at this line:
DependencyRelation headRelation = (DependencyRelation) casDepNode.getHeadRelations().get(0);
Even if this line is skipped, this condition causes problems downstream when
actually running ClearNLP. A sentence consisting solely of a URL will produce
this kind of condition.
The simplest solution is to add a skipSentence boolean flag, that skips both
setup and execution of ClearNLP for these kinds of sentences.
Original issue reported on code.google.com by lee.becker on 5 Dec 2012 at 11:20
Original issue reported on code.google.com by
lee.becker
on 5 Dec 2012 at 11:20