Thursday, 15 April 2010

xml parsing - How to perform coreference Resolution in Java using Standford core NLP? -



xml parsing - How to perform coreference Resolution in Java using Standford core NLP? -

i have paragraph of text, , want perform coref resolution on it, pronouns in replaced nouns. here's code i'm using:

properties props = new properties(); props.put("annotators", "tokenize, ssplit,pos,lemma,ner,parse,dcoref"); stanfordcorenlp pi= new stanfordcorenlp(props); string text = "delhi capital city of india.it sec populous metropolis in republic of india after bombay , largest city in terms of area."; annotation doc = new annotation(text); pi.annotate(doc); map<integer, corefchain> graph = doc.get(corefchainannotation.class); (map.entry entry : graph.entryset()) { corefchain c = (corefchain) entry.getvalue(); corefmention cm = c.getrepresentativemention(); system.out.println(c); }

java xml-parsing stanford-nlp

No comments:

Post a Comment