I want to use the coreference resolution from Stanford NLP. I have downloaded the latest version 3.6.But when I run the following code, I am getting NullPointerException. I looked up in net, and few people seem to have to experienced the same problem, but no solution is mentioned. Any help would be appreciated.
public static void main(String[] args) {
Properties props = new Properties();
props.put("annotators", "tokenize, ssplit, pos, lemma, ner, parse, dcoref");
props.put("dcoref.score", true);
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
String sentence="Stanford University is located in California. It is a great university, founded in 1891.";
Annotation document = new Annotation(sentence);
pipeline.annotate(document);
System.out.println(document);
Map<Integer, CorefChain> graph = document.get(CorefChainAnnotation.class);
Set<Integer> set=graph.keySet();
Iterator <Integer> it=set.iterator();
while(it.hasNext()) {
CorefChain c=graph.get(it.next());
System.out.println("CorefChain: "+c);
}
}