Package nltk :: Package chunk :: Module named_entity :: Class NEChunkParser
[hide private]
[frames] | no frames]

type NEChunkParser

source code

       object --+        
                |        
parse.api.ParserI --+    
                    |    
     api.ChunkParserI --+
                        |
                       NEChunkParser

Expected input: list of pos-tagged words

Instance Methods [hide private]
 
__init__(self, train) source code
Tree
parse(self, tokens)
Each token should be a pos-tagged word
source code
 
_train(self, corpus) source code
 
_tagged_to_parse(self, tagged_tokens)
Convert a list of tagged tokens to a chunk-parse tree.
source code

Inherited from api.ChunkParserI: evaluate

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

Static Methods [hide private]
 
_parse_to_tagged(sent)
Convert a chunk-parse tree to a list of tagged tokens.
source code
Method Details [hide private]

__init__(self, train)
(Constructor)

source code 
Overrides: object.__init__
(inherited documentation)

parse(self, tokens)

source code 

Each token should be a pos-tagged word

Parameters:
  • tokens - 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