piskvorky/gensim

bug in gensim.summarization.mz_entropy.mz_keywords

Open

#2523 aperta il 10 giu 2019

Vedi su GitHub
 (1 commento) (1 reazione) (0 assegnatari)Python (4349 fork)batch import
Hacktoberfestbugdifficulty easygood first issueimpact LOWreach LOW

Metriche repository

Star
 (15.144 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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)

Guida contributor