def score(count_bigram, count1, count2, n_words):
 N = n_words
 c12 = count_bigram
 c1 = count1
 c2 = count2
 p = (c2 / N)
 p1 = (c12 / c1)
 p2 = ((c2 - c12) / (N - c1))
 score = (((l(c12, c1, p) + l((c2 - c12), (N - c1), p)) - l(c12, c1, p1)) - l((c2 - c12), (N - c1), p2))
 return ((-2) * score)

def score ( count_bigram , count1 , count2 , n_words ) : N = n_words c12 = count_bigram c1 = count1 c2 = count2 p = ( c2 / N ) p1 = ( c12 / c1 ) p2 = ( ( c2 - c12 ) / ( N - c1 ) ) score = ( ( ( l ( c12 , c1 , p ) + l ( ( c2 - c12 ) , ( N - c1 ) , p ) ) - l ( c12 , c1 , p1 ) ) - l ( ( c2 - c12 ) , ( N - c1 ) , p2 ) ) return ( ( - 2 ) * score )
score sentences based on different features .