I've previously used the NgramModel
class in nltk without error. However, I recently updated 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 the error
ImportError: No module named 'nltk.model'
.
Has NgramModel
or the model
module been recently replaced?
This is an open issue because of bugs.
This is noted in the issue:
If you're currently using the version from github, you can switch to the "model" branch, which includes the NgramModel code, though it's currently significantly behind the "develop" branch and hasn't picked up all the newest bug fixes.
The link to the model branch is here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With