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)
| 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): |