April 2019
Beginner to intermediate
386 pages
11h 20m
English
The LexicalizedParser class was used to generate the parse tree using the apply method. The method used a list of CoreLabel instances, each of which represents a word. This list was created using the tokenizer executed against the sentence:
LexicalizedParser lexicalizedParser = LexicalizedParser.loadModel("englishPCFG.ser.gz");String sentence = "The old man sat down beside the tree.";TokenizerFactory<CoreLabel> tokenizerFactory = PTBTokenizer.factory(new CoreLabelTokenFactory(), "");Tokenizer<CoreLabel> tokenizer = tokenizerFactory.getTokenizer(new StringReader(sentence));List<CoreLabel> coreLabelList = tokenizer.tokenize();Tree parseTree = lexicalizedParser.apply(coreLabelList);
A Treebank is created from a large corpus ...
Read now
Unlock full access