Error nltk NgramModel

I previously used the NgramModel class in nltk with no errors. However, I recently upgraded nltk to version 3.1 , and I can no longer find the NgramModel class. When I try to import as usual:

from nltk.model import NgramModel

I get an error

ImportError: No module named 'nltk.model' .

Was the NgramModel or model module recently replaced?

+5
source share
1 answer

This is an open problem due to errors .

This is noted in the release:

If you are using the github version, you can switch to the "model" branch, which includes the NgramModel code, although at present it is significantly behind the "development" branch and has not selected a whole new fix error.

Link to the model branch here .

+6
source

Source: https://habr.com/ru/post/1240019/


All Articles