Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return keywords before matrix processing if no graph edges. Fixes #2075 #2154

Merged
merged 2 commits into from
Aug 10, 2018

Conversation

lshostenko
Copy link
Contributor

@lshostenko lshostenko commented Aug 10, 2018

This PR fix #2075 ZeroDivisionError in cases like one- or two-word texts:

from gensim.summarization import keywords

keywords('gensim')  # raises ZeroDivisionError
keywords('sitio construcción. estaremos línea', deacc=False)  # raises ZeroDivisionError
keywords('sitio construcción. estaremos línea', deacc=True)  # returns empty result

@lshostenko lshostenko changed the title Return keywords before matrix processing if no graph edges. Return keywords before matrix processing if no graph edges. Fixes #2075 Aug 10, 2018
Copy link
Contributor

@menshikh-iv menshikh-iv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for PR @lshostenko, please add a test that covers mentioned issue and I'll merge your PR

@menshikh-iv
Copy link
Contributor

Congratz with first contribution @lshostenko 👍

@menshikh-iv menshikh-iv merged commit 17fa0dc into piskvorky:develop Aug 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ZeroDivisionError: float division by zero
2 participants