2759b03d85983fedd29b646380c713c3f4ccff66,nltk/lm/smoothing.py,WittenBell,alpha,#WittenBell#Any#Any#,23

Before Change


        return n_plus / (n_plus + self.counts[len(context) + 1].N())

    def alpha(self, word, context):
        return (1 - self.gamma(context)) * self.mle.score(word, context)

    def beta(self, word, context):
        return self.beta_model.score(word, context)

After Change


        return self.counts.unigrams.freq(word)

    def alpha(self, word, context):
        return self.counts[context].freq(word)

    def gamma(self, context):
        n_plus = sum(1 for c in self.counts[context].values() if c > 0)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: nltk/nltk
Commit Name: 2759b03d85983fedd29b646380c713c3f4ccff66
Time: 2018-08-16
Author: ilia.kurenkov@gmail.com
File Name: nltk/lm/smoothing.py
Class Name: WittenBell
Method Name: alpha


Project Name: scipy/scipy
Commit Name: ae151484780b389b5c7b4530c9ac1ef4bb659e23
Time: 2020-01-13
Author: rlucas7@users.noreply.github.com
File Name: scipy/special/_basic.py
Class Name:
Method Name: factorial


Project Name: nltk/nltk
Commit Name: ce74e449dc9526e19596b1c4a9c510bbb35812cc
Time: 2019-08-11
Author: ilia.kurenkov@gmail.com
File Name: nltk/lm/smoothing.py
Class Name: KneserNey
Method Name: alpha_gamma