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

Division by zero by rouge.py, only in some algos #205

Open
Manamama opened this issue Feb 6, 2024 · 1 comment
Open

Division by zero by rouge.py, only in some algos #205

Manamama opened this issue Feb 6, 2024 · 1 comment

Comments

@Manamama
Copy link

Manamama commented Feb 6, 2024

Only in sumy_eval, and mostly edmundson, lsa, luhn (not e.g. text-rank - update, also in this, it is random) throw the below:

sumy_eval edmundson  ~/Downloads/crown_land_eng_60.txt  --length=60%  --language=eng --url=https://en.wikipedia.org/wiki/Crown_land
Precision: 0.500000
Recall: 0.514563
F-score: 0.507177
Cosine similarity: 0.952655
Cosine similarity (document): 0.950033
Unit overlap: 0.485461
Unit overlap (document): 0.502559
Rouge-1: 0.551075
Rouge-2: 0.448803
Rouge-L (Sentence Level): 0.498733
Traceback (most recent call last):
  File ".local/bin/sumy_eval", line 8, in <module>
    sys.exit(main())
  File ".local/lib/python3.10/site-packages/sumy/evaluation/__main__.py", line 171, in main
    result = evaluate(evaluated_sentences, reference_sentences)
  File ".local/lib/python3.10/site-packages/sumy/evaluation/rouge.py", line 290, in rouge_l_summary_level
    union_lcs_sum_across_all_references += _union_lcs(evaluated_sentences, ref_s)
  File ".local/lib/python3.10/site-packages/sumy/evaluation/rouge.py", line 250, in _union_lcs
    union_lcs_value = union_lcs_count / combined_lcs_length
ZeroDivisionError: division by zero

My box


Operating System: Ubuntu 22.04.3 LTS x86_64
Kernel: 6.2.0-39-generic
Shell: /bin/bash 5.1.16
Python: 3.10.12

@Manamama
Copy link
Author

Manamama commented Feb 6, 2024

Update. And this

sumy_eval sum-basic ...

or even
sumy sum-basic --length=60% --language=eng ...
results in

  File ".local/lib/python3.10/site-packages/sumy/summarizers/sum_basic.py", line 75, in <listcomp>
    word_freq_sum = sum([word_freq_in_doc[w] for w in content_words_in_sentence])
KeyError: 'own'

(while kl, lsa etc. work fine)

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

No branches or pull requests

1 participant