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

ZeroDivisionError: float division by zero in pagerank_weighted.py #851

Closed
bofinbabu opened this issue Sep 7, 2016 · 4 comments
Closed
Assignees
Labels
bug Issue described a bug difficulty easy Easy issue: required small fix

Comments

@bofinbabu
Copy link

Got ZeroDivisionError: float division by zero in pagerank_weighted.py

Input Text: BYAnonymousArabe

Error thrown at: summarize(text_to_sum, word_count=50)

gensim error

I know word_count is 50 and I'm just giving a word. But ideally it should output that single word instead of throwing an error isn't it?

Please throw some light

@tmylk tmylk added bug Issue described a bug difficulty easy Easy issue: required small fix labels Sep 25, 2016
@pranay360
Copy link
Contributor

@tmylk for changes to be made what should be the expected output should it raise an error saying "not enough text to summarize", or just output the single word as it is(if its length is > 10 i.e. INPUT_MIN_LENGTH)?

@tmylk
Copy link
Contributor

tmylk commented Sep 26, 2016

Output less than word_count should be allowed

@bofinbabu
Copy link
Author

@tmylk Yes. I agree with you

@tmylk
Copy link
Contributor

tmylk commented Sep 29, 2016

Fixed in #887

@tmylk tmylk closed this as completed Sep 29, 2016
tmylk pushed a commit that referenced this issue Sep 29, 2016
* Update summarizer.py

Return statement removed and error raised.

* Update test_summarization.py

Removed test for single sentence input.

* Update CHANGELOG.md

* Update summarizer.py

* Update test_wikicorpus.py

* Update test_summarization.py
harshuljain13 pushed a commit to harshuljain13/gensim that referenced this issue Sep 30, 2016
…iskvorky#902)

* Update summarizer.py

Return statement removed and error raised.

* Update test_summarization.py

Removed test for single sentence input.

* Update CHANGELOG.md

* Update summarizer.py

* Update test_wikicorpus.py

* Update test_summarization.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue described a bug difficulty easy Easy issue: required small fix
Projects
None yet
Development

No branches or pull requests

3 participants