Named Entity Recognition for NLTK in Python. Identifying the NE

前端 未结 5 495
野趣味
野趣味 2021-01-30 18:25

I need to classify words into their parts of speech. Like a verb, a noun, an adverb etc.. I used the

nltk.word_tokenize() #to identify word in a sentence 
nltk.         


        
5条回答
  •  温柔的废话
    2021-01-30 18:48

    Below is my code:

    chunks = ne_chunk(postags, binary=True)
    for c in chunks:
      if hasattr(c, 'node'):
        myNE.append(' '.join(i[0] for i in c.leaves()))
    

提交回复
热议问题