nltk NgramModel error

0 votes
The NgramModel class in nltk was working fine 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? is there any other process?
May 15 in Python by ana1504.k
• 7,870 points

1 answer to this question.

0 votes
This is an open issue because of bugs.

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.
answered May 15 by SDeb
• 13,180 points

Related Questions In Python

+2 votes
2 answers

Error while printing hello world in python.

You must be trying this command in ...READ MORE

answered Mar 31, 2018 in Python by GandalfDwhite
• 1,320 points
0 votes
2 answers

Indentation Error in Python

Use tabs instead of spaces. This is ...READ MORE

answered Feb 14 in Python by Shashank
• 1,350 points
0 votes
1 answer

'Syntax Error: invalid syntax' for no apparent reason

You're missing a close paren in this ...READ MORE

answered Aug 13, 2018 in Python by Priyaj
• 56,900 points
+1 vote
1 answer

How to print an error in Python?

For Python 2.6 and later and Python ...READ MORE

answered Aug 23, 2018 in Python by Priyaj
• 56,900 points
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 328 views
0 votes
1 answer

Key error in Python

A KeyError occurs when the Key doesn't ...READ MORE

answered Sep 20, 2018 in Python by SDeb
• 13,180 points
0 votes
11 answers