Skip to content

Comparison.score.kld

Comparison.score.kld

kld(base: float = 2) -> Comparison

Calculates the Kullback-Leibler divergence (KLD) between the reference and comparison corpora.

Alias for kullback_leibler_divergence; see that method for more details.

Parameters:

Name Type Description Default

base

float

Base of the logarithms used to calculate the KLD

2

Returns:

Type Description
Comparison

A new Comparison scored by the Kullback-Leibler divergence

Source