Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #1859: TypeError in HiddenMarkovModelTrainer train_unsupervised #1873

Conversation

PavanGJ
Copy link
Contributor

@PavanGJ PavanGJ commented Oct 25, 2017

Added a method definition for abstract method max in RandomProbDist and MutableProbDist classes.

@stevenbird
Copy link
Member

@PavanGJ would you please document the reason for this PR

@PavanGJ
Copy link
Contributor Author

PavanGJ commented Oct 30, 2017

Hi @stevenbird

This PR fixes a bug reported in #1859.

RandomProbDist and MutableProbDist extend ProbDistI which defines an abstract method max. The abstract method is not overridden in RandomProbDist and MutableProbDist causing errors such as
TypeError: Can't instantiate abstract class RandomProbDist with abstract methods max

When a model is not defined, HiddenMarkovModelTagger uses both RandomProbDist and MutableProbDist in train_unsupervised method.

This PR defines the method max in the two classes to overcome this bug.

@PavanGJ
Copy link
Contributor Author

PavanGJ commented Oct 30, 2017

@stevenbird Kindly let me know if I need to document the reason for this PR elsewhere

@stevenbird stevenbird merged commit e328ce2 into nltk:develop Nov 2, 2017
@stevenbird
Copy link
Member

stevenbird commented Nov 2, 2017

Excellent, thanks @PavanGJ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants