Open olegs opened 2 years ago
@ctrltz is it possible to use np.log1p
to avoid this problem?
Sure, but if tokens_freqs_total
equals 0, I think it means that the whole corpus_counts
contains only zeros, and one might also separate this case implicitly like:
if not corpus_counts.sum():
return *empty descriptions here*
Did not keep evolution in mind when worked on the topics description, thanks for pointing it.
Also tokens_freqs_norm may be zero. What is correct fix for this?
As far as I understand, it means that some of the components have no corpus terms to be analyzed, so it would be correct to return an empty description for the respective components.
It might be simpler to plug in np.log1p
at the moment to ensure stability, and I can think a bit more in the coming days.
NB: I have also fixed the previous comment in case you have used it already.
To reproduce use predefined "brain computer interface" search from Pubmed.