私はスタンフォードCoreNLPの使用を回避しようとしています。私は、Webからコードを使用して、何がcoreferenceツールで行われているのかを理解しました。 Eclipseでプロジェクトを実行しようとしましたが、メモリ不足例外が発生しています。私はヒープサイズを増やしてみましたが、違いはありません。なぜこれが起こっているのかについてのアイデアはありますか?これはコード固有の問題ですか? CoreNLPを使用する方向は素晴らしいです。スタンフォードCoreNLPの使用
EDIT - EclipseでスタンフォードCoreNLPを使用して小さなアプリケーションを構築する際、私は同様の問題を発見した
import edu.stanford.nlp.dcoref.CorefChain;
import edu.stanford.nlp.dcoref.CorefCoreAnnotations;
import edu.stanford.nlp.pipeline.Annotation;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
public class testmain {
public static void main(String[] args) {
String text = "Viki is a smart boy. He knows a lot of things.";
Annotation document = new Annotation(text);
Properties props = new Properties();
props.put("annotators", "tokenize, ssplit, pos, parse, dcoref");
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
pipeline.annotate(document);
Map<Integer, CorefChain> graph = document.get(CorefCoreAnnotations.CorefChainAnnotation.class);
Iterator<Integer> itr = graph.keySet().iterator();
while (itr.hasNext()) {
String key = itr.next().toString();
String value = graph.get(key).toString();
System.out.println(key + " " + value);
}
}
}
ここにコードを投稿 –
@Pangeaコードを追加しました。 –
私はcorenlpを-Xms4gとeclipseで使用しています。 – alienCoder