<s> """<STR_LIT>""" <EOL> from nltk . data import load <EOL> from nltk . chunk . api import ChunkParserI <EOL> from nltk . chunk . util import ( ChunkScore , accuracy , tagstr2tree , conllstr2tree , <EOL> conlltags2tree , tree2conlltags , tree2conllstr , tree2conlltags , <EOL> ieerstr2tree ) <EOL> from nltk . chunk . regexp import RegexpChunkParser , RegexpParser <EOL> _BINARY_NE_CHUNKER = '<STR_LIT>' <EOL> _MULTICLASS_NE_CHUNKER = '<STR_LIT>' <EOL> def ne_chunk ( tagged_tokens , binary = False ) : <EOL> """<STR_LIT>""" <EOL> if binary : <EOL> chunker_pickle = _BINARY_NE_CHUNKER <EOL> else : <EOL> chunker_pickle = _MULTICLASS_NE_CHUNKER <EOL> chunker = load ( chunker_pickle ) <EOL> return chunker . parse ( tagged_tokens ) <EOL> def ne_chunk_sents ( tagged_sentences , binary = False ) : <EOL> """<STR_LIT>""" <EOL> if binary : <EOL> chunker_pickle = _BINARY_NE_CHUNKER <EOL> else : <EOL> chunker_pickle = _MULTICLASS_NE_CHUNKER <EOL> chunker = load ( chunker_pickle ) <EOL> return chunker . parse_sents ( tagged_sentences ) </s>
