का उपयोग करके मैं स्टैनफोर्ड कोरएनएलपी का उपयोग करके घूमने की कोशिश कर रहा हूं। मैंने कोरेंस टूल के साथ क्या चल रहा है यह समझने के लिए वेब से कुछ कोड का उपयोग किया। मैंने ग्रहण में प्रोजेक्ट चलाने की कोशिश की लेकिन मेमोरी अपवाद से बाहर निकलना जारी रखा। मैंने ढेर के आकार में वृद्धि करने की कोशिश की लेकिन इसमें कोई फर्क नहीं पड़ता। इस बारे में कोई विचार क्यों चल रहा है? क्या यह एक कोड विशिष्ट समस्या है? 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 जोड़ा गया कोड। –
मैं xx4g के साथ ग्रहण में corenlp का उपयोग करता हूं और यह ठीक काम करता है। – alienCoder