Question

The typed dependencies given by Stanford parser online and the dependencies generated by the sourcecode given aren't same.

The 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?

Was it helpful?

Solution

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);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top