MCPcopy
hub / github.com/nltk/nltk / mi_like

Method mi_like

nltk/metrics/association.py:124–131  ·  view source on GitHub ↗

Scores ngrams using a variant of mutual information. The keyword argument power sets an exponent (default 3) for the numerator. No logarithm of the result is calculated.

(*marginals, **kwargs)

Source from the content-addressed store, hash-verified

122
123 @staticmethod
124 def mi_like(*marginals, **kwargs):
125 """Scores ngrams using a variant of mutual information. The keyword
126 argument power sets an exponent (default 3) for the numerator. No
127 logarithm of the result is calculated.
128 """
129 return marginals[NGRAM] ** kwargs.get("power", 3) / _product(
130 marginals[UNIGRAMS]
131 )
132
133 @classmethod
134 def pmi(cls, *marginals):

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected