piskvorky/gensim

bug in gensim.summarization.mz_entropy.mz_keywords

Open

#2,523 opened on Jun 10, 2019

View on GitHub
 (1 comment) (1 reaction) (0 assignees)Python (15,144 stars) (4,349 forks)batch import
Hacktoberfestbugdifficulty easygood first issueimpact LOWreach LOW

Description

Problem statement:

It seems to be a bug if the text is too short and number of words is lower than blocksize. In my case the values were: n_words (232.0) and blocksize (1024).

Log:

gensim\summarization\mz_entropy.py:127: RuntimeWarning: invalid value encountered in double_scalars
  - __log_combinations(n_words, blocksize)

Dirty solution:

Override blocksize value from the default 1024 to something lower:

mz_keywords(text, blocksize=128)

Contributor guide