Typed dependencies for the Stanford parser
The typed dependencies given by Stanford parser online and the dependencies generated by the sourcecode given aren't same.
T开发者_运维技巧he versions of source codes available in Stanford website does not generate abbrev, possessive and poss tags.
Which version of Stanford parser to use for generating these tags?
They are the same. The answer was that you had to invoke the parser in a way that would cause tokenization of the input. Some examples are:
LexicalizedParser lp = LexicalizedParser.loadModel("edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz");
String sent = "This is one last test!";
lp.apply(sent).pennPrint();
or in a more complex scenario:
TreebankLanguagePack tlp = lp.getOp().langpack();
Tokenizer<? extends HasWord> toke = tlp.getTokenizerFactory().getTokenizer(new StringReader(sent));
List<? extends HasWord> sentence = toke.tokenize();
lp.apply(sentence);
精彩评论