NLTK 2.0 classifier batch classifier method

前端 未结 1 1072
清歌不尽
清歌不尽 2021-01-27 10:39

When I run this code it throws an error which I believe is due to the batch_classify method not being present in NLTK 3.0. I curious how to resolve this type of issue where some

相关标签:
1条回答
  • 2021-01-27 10:59

    The method was renamed to classify_many() (I couldn't find documentation of NLTK 2.0 to check it, but I'm pretty sure that's what happened).

    You have to replace all occurrences of batch_classify(...) with classify_many(...) in your code. When moving from one major version of a library to another, you have to expect this kind of backwards-incompatible changes; they should ideally be documented in the changelog. However, I have to admit that in the past NLTK introduced backwards-incompatible changes even between minor versions, which I think is bad practice.

    0 讨论(0)
提交回复
热议问题