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

Another issue with NgramModel.prob() #388

Closed
awahl1 opened this issue Apr 13, 2013 · 5 comments
Closed

Another issue with NgramModel.prob() #388

awahl1 opened this issue Apr 13, 2013 · 5 comments

Comments

@awahl1
Copy link

awahl1 commented Apr 13, 2013

Maybe this is related to Issue #380 and issue #367 .

When I call this function twice on the same word and context, the first time I get a probability value, but the second time I get an error.

corpus = ['one','fish','two','fish']
model = NgramModel(2,corpus)
model.prob('fish','one')

which returns the value 1.0. But then when I immediately call model.prob again on the same bigram, I get an attribute error "'SimpleGoodTuringProbDist' object has no attribute '_intercept'"

@dan-blanchard
Copy link
Contributor

This looks to me like more of an error in SimpleGoodTuringProbDist than NgramModel itself (granted there are issues abound with NgramModel right now). It may also have something to do with the fact that NgramModel.prob expects different arguments than you're providing. It should be model.prob('fish', ['one']) because the context has to be a list (even with bigram models).

@stevenbird
Copy link
Member

@copper-head would you please confirm if this issue is current?

@iliakur
Copy link
Contributor

iliakur commented Oct 23, 2017

@stevenbird seeing as the interfaces in the model package are drastically different now, this is no longer relevant. I'd close it.

@iliakur
Copy link
Contributor

iliakur commented Aug 25, 2018

@stevenbird @alvations we should close this :)

@alvations
Copy link
Contributor

alvations commented Aug 28, 2018

Should be outdated given the new Ngram model module now #2077 =)

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

No branches or pull requests

5 participants