ColdMillenium / jwpl

Automatically exported from code.google.com/p/jwpl
0 stars 0 forks source link

Problem with Hyponym Count of Categories #100

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
Many categories that should have a non-zero hyponym count (from the 
hyponymCountMap of the CategoryGraph class) instead have negative hyponym counts

What version of the product are you using? On what operating system?
JWPL-0.9.1

Please provide any additional information below.
I noticed the above problem when the Intrinsic Information Content (IIC) of 
many categories returned the value -1. When I investigated the CategroyGraph 
class, I noticed that the IIC of these categories is -1 because their hyponym 
count (returned by the hyponymCountMap) is < 0. Surely this can't be right. The 
hyponym count of a node cannot be negative. I later found that when calculating 
the hyponym counts in the createHyponymCountMap function, some of the local 
variables were declared as int (sumChildHyponyms, childHyponymCount and 
currNodeHyponymCount). At some point in the calculation, these variables exceed 
the range of int (2,147,483,647) and the value gets flipped to negative 
(-2,147,483,647). I was able to solve this problem by changing the types of 
these variables to long. I suggest perhaps you do the same in the distribution 
version.

Original issue reported on code.google.com by yayasa...@gmail.com on 19 Jul 2012 at 2:32

GoogleCodeExporter commented 9 years ago
Thanks for the report and for figuring out a solution.
Do you like to provide a patch? We'd be happy to apply it and ship it with the 
next release.

Original comment by oliver.ferschke on 20 Jul 2012 at 10:14