ne_chunk without pos_tag in NLTK
问题 I'm trying to chunk a sentence using ne_chunk and pos_tag in nltk. from nltk import tag from nltk.tag import pos_tag from nltk.tree import Tree from nltk.chunk import ne_chunk sentence = "Michael and John is reading a booklet in a library of Jakarta" tagged_sent = pos_tag(sentence.split()) print_chunk = [chunk for chunk in ne_chunk(tagged_sent) if isinstance(chunk, Tree)] print print_chunk and this is the result: [Tree('GPE', [('Michael', 'NNP')]), Tree('PERSON', [('John', 'NNP')]), Tree('GPE