python-course icon indicating copy to clipboard operation
python-course copied to clipboard

Is the test for compute_ARI() correct?

Open vcidst opened this issue 10 years ago • 2 comments

In book branch, chapter 5 I believe the test for compute_ARI isn't correct. I have checked that the Automatic Readability Index for the sentence 'This was rather easy. Please give me something more challenging' is 6.033

The condition however is abs(compute_ARI(sentences) - 4.442) < 0.001 which will always be false

vcidst avatar Jul 13 '15 05:07 vcidst

Thanks for this. Chapter five still needs quite some polishing. This will be helpful in that.

fbkarsdorp avatar Jul 13 '15 07:07 fbkarsdorp

Okay I figured out that the ARI of sentences when it is

sentences = [["this", "was", "rather", "easy"], 
             ["Please", "give", "me", "something", "more", "challenging"]]

is 6.033. However, if you sentences[0].append(".") or add a period there, the ARI of sentences become 4.442.

Not saying that the period should be there, it shouldn't. Only thought it'll be helpful to know where you got that magic number 4.442 in the condition from.

vcidst avatar Jul 13 '15 12:07 vcidst