NLTK for Named Entity Recognition

前端 未结 3 671
南方客
南方客 2021-01-30 11:33

I am trying to use NLTK toolkit to get extract place, date and time from text messages. I just installed the toolkit on my machine and I wrote this quick snippet to test it out:

3条回答
  •  执念已碎
    2021-01-30 11:46

    Named entity recognition is not an easy problem, do not expect any library to be 100% accurate. You shouldn't make any conclusions about NLTK's performance based on one sentence. Here's another example:

    sentence = "I went to New York to meet John Smith";
    

    I get

    (S
      I/PRP
      went/VBD
      to/TO
      (NE New/NNP York/NNP)
      to/TO
      meet/VB
      (NE John/NNP Smith/NNP))
    

    As you can see, NLTK does very well here. However, I couldn't get NLTK to recognise today or tomorrow as temporal expressions. You can try Stanford SUTime, it is a part of Stanford CoreNLP- I have used it before I it works quite well (it is in Java though).

提交回复
热议问题