Named Entity Recognition for NLTK in Python. Identifying the NE

前端 未结 5 497
野趣味
野趣味 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:55

    I agree with bdk

    sent3[2].node

    O/P - 'NE'

    I think there is no function in nltk to do it.Above solution will work but for reference you can check here

    for looping problem you can do :-

     for i in range(len(sent3)):
         if "NE" in str(sent3[i]):
              print sent3[i].node
    

    I have executed this in nltk and it works fine..

提交回复
热议问题