@classmethod
    def likelihood_ratio(cls, *marginals):
        """Scores ngrams using likelihood ratios as in Manning and Schutze 5.3.4.
        """
        cont = cls._contingency(*marginals)
        return (cls._n *
                sum(obs * _ln(obs / (exp + _SMALL) + _SMALL)
                    for obs, exp in zip(cont, cls._expected_values(cont))))
dataset/ETHPy150Open nltk/nltk/nltk/metrics/association.py/NgramAssocMeasures.likelihood_ratio/original