sourish-rygbee / dkpro-similarity-asl

Automatically exported from code.google.com/p/dkpro-similarity-asl
0 stars 0 forks source link

MTLDComparator, SentenceRatioComparator, TokenRatioComparator make Infinity result #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For certain pairs of JCas texts, the metrics MTLDComparator, 
SentenceRatioComparator, and TokenRatioComparator give an output of Infinity 
instead of a regular double.  This can break downstream processing.  It would 
be helpful if the metrics instead outputted a very large number that could 
still be read as a double.

It appears that Infinity is returned if, due to the text annotation in the JCas 
passed into the metric, one of the annotation counts for a text is 0.  All 
three metrics have denominators of unscreened annotation counts.  

This problem could be fixed by checking if a metric's denominator is 0, and if 
so, substituting a very-small-but-not-0 number in its place.

Original issue reported on code.google.com by EmilyKJa...@gmail.com on 9 Nov 2012 at 3:57

GoogleCodeExporter commented 9 years ago

Original comment by daniel.b...@sap.com on 12 Nov 2012 at 1:44