From: <ada...@us...> - 2017-02-07 13:14:06
|
Revision: 20069 http://sourceforge.net/p/gate/code/20069 Author: adamfunk Date: 2017-02-07 13:14:03 +0000 (Tue, 07 Feb 2017) Log Message: ----------- Suppress NPEs (use zeros instead) when people don't use enough documents in the corpus. Modified Paths: -------------- gate/trunk/plugins/TermRaider/resources/jape/augmentation.jape gate/trunk/plugins/TermRaider/resources/jape/term-candidate-threshold.jape Modified: gate/trunk/plugins/TermRaider/resources/jape/augmentation.jape =================================================================== --- gate/trunk/plugins/TermRaider/resources/jape/augmentation.jape 2017-02-07 02:23:36 UTC (rev 20068) +++ gate/trunk/plugins/TermRaider/resources/jape/augmentation.jape 2017-02-07 13:14:03 UTC (rev 20069) @@ -33,7 +33,5 @@ } } - if (score > 0.0F) { - inner.getFeatures().put("localAugTfIdf", score); - } + inner.getFeatures().put("localAugTfIdf", score); } Modified: gate/trunk/plugins/TermRaider/resources/jape/term-candidate-threshold.jape =================================================================== --- gate/trunk/plugins/TermRaider/resources/jape/term-candidate-threshold.jape 2017-02-07 02:23:36 UTC (rev 20068) +++ gate/trunk/plugins/TermRaider/resources/jape/term-candidate-threshold.jape 2017-02-07 13:14:03 UTC (rev 20069) @@ -18,7 +18,7 @@ // & look in the lower left corner. If the feature is missing, // the fallback given above is used. - if (oldf.containsKey("tfIdfAug") && + if ( (oldf.get("tfIdfAug") != null) && (((Double) oldf.get("tfIdfAug")) > threshold) ) { Long start = ann.getStartNode().getOffset(); Long end = ann.getEndNode().getOffset(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |