Package nltk :: Package chunk :: Module api :: Class ChunkParserI
[hide private]
[frames] | no frames]

type ChunkParserI

source code

       object --+    
                |    
parse.api.ParserI --+
                    |
                   ChunkParserI
Known Subclasses:

A processing interface for identifying non-overlapping groups in unrestricted text. Typically, chunk parsers are used to find base syntactic constituants, such as base noun phrases. Unlike ParserI, ChunkParserI guarantees that the parse method will always generate a parse.

Instance Methods [hide private]
Tree
parse(self, tokens)
Returns: the best chunk structure for the given tokens and return a tree.
source code
ChunkScore
evaluate(self, gold)
Score the accuracy of the chunker against the gold standard.
source code

Inherited from parse.api.ParserI: batch_iter_parse, batch_nbest_parse, batch_parse, batch_prob_parse, grammar, iter_parse, nbest_parse, prob_parse

    Deprecated

Inherited from parse.api.ParserI: batch_test, get_parse, get_parse_dict, get_parse_list, get_parse_prob

Method Details [hide private]

parse(self, tokens)

source code 
Parameters:
  • tokens (list of tuple) - The list of (word, tag) tokens to be chunked.
Returns: Tree
the best chunk structure for the given tokens and return a tree.
Overrides: parse.api.ParserI.parse

evaluate(self, gold)

source code 

Score the accuracy of the chunker against the gold standard. Remove the chunking the gold standard text, rechunk it using the chunker, and return a ChunkScore object reflecting the performance of this chunk peraser.

Parameters:
  • gold (list of Tree) - The list of chunked sentences to score the chunker on.
Returns: ChunkScore