Skip to content

Commit

Permalink
Merge branch 'nltk:develop' into naissue_3189
Browse files Browse the repository at this point in the history
  • Loading branch information
Higgs32584 committed Feb 4, 2024
2 parents 2032f41 + f2a92bd commit 1fb4e30
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nltk/lm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ def context_counts(self, context):
def entropy(self, text_ngrams):
"""Calculate cross-entropy of model for given evaluation text.
This implementation is based on the Shannon-McMillan-Breiman theorem,
as used and referenced by Dan Jurafsky and Jordan Boyd-Graber.
:param Iterable(tuple(str)) text_ngrams: A sequence of ngram tuples.
:rtype: float
Expand Down

0 comments on commit 1fb4e30

Please sign in to comment.