Я новичок в разрешении Coreference, когда мы запустим программу, она выдаст ошибку, которую я очень запутался, пожалуйста, помогите мне с этим
Annotation document = new Annotation("Barack Obama was born in Hawaii. He is the president. Obama was elected in 2008.");
Properties props = new Properties();
props.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner,parse,coref");
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
pipeline.annotate(document);
System.out.println("---");
System.out.println("coref chains");
for (CorefChain cc : document.get(CorefCoreAnnotations.CorefChainAnnotation.class).values()) {
System.out.println("\t" + cc);
}
for (CoreMap sentence : document.get(CoreAnnotations.SentencesAnnotation.class)) {
System.out.println("---");
System.out.println("mentions");
for (Mention m : sentence.get(CorefCoreAnnotations.CorefMentionsAnnotation.class)) {
System.out.println("\t" + m);
}
Произошла ошибка, упомянутая ниже
> Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.Arrays.copyOfRange(Unknown Source)
at java.lang.String.<init>(Unknown Source)
at edu.stanford.nlp.util.StringUtils.splitOnChar(StringUtils.java:537)
at edu.stanford.nlp.coref.data.Dictionaries.loadGenderNumber(Dictionaries.java:405)
at edu.stanford.nlp.coref.data.Dictionaries.<init>(Dictionaries.java:676)
at edu.stanford.nlp.coref.data.Dictionaries.<init>(Dictionaries.java:576)
at edu.stanford.nlp.coref.CorefSystem.<init>(CorefSystem.java:32)
at edu.stanford.nlp.pipeline.CorefAnnotator.<init>(CorefAnnotator.java:66)
at edu.stanford.nlp.pipeline.AnnotatorImplementations.coref(AnnotatorImplementations.java:196)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.lambda$getNamedAnnotators$53(StanfordCoreNLP.java:555)
at edu.stanford.nlp.pipeline.StanfordCoreNLP$$Lambda$24/544724190.apply(Unknown Source)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.lambda$null$69(StanfordCoreNLP.java:625)
at edu.stanford.nlp.pipeline.StanfordCoreNLP$$Lambda$37/1673605040.get(Unknown Source)
at edu.stanford.nlp.util.Lazy$3.compute(Lazy.java:126)
at edu.stanford.nlp.util.Lazy.get(Lazy.java:31)
at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:149)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:495)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:201)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:194)
at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:181)
at test.test.main(test.java:17)