fbkarsdorp / python-course

Tutorial and introduction into programming with Python for the humanities and social sciences
http://www.karsdorp.io/python-course/
423 stars 297 forks source link

Is the test for compute_ARI() correct? #17

Open vcidst opened 9 years ago

vcidst commented 9 years ago

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

fbkarsdorp commented 9 years ago

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

vcidst commented 9 years ago

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.