Revision 52803
Added by Claudio Atzori over 5 years ago
AbstractEnrichmentReducer.java | ||
---|---|---|
148 | 148 |
}); |
149 | 149 |
} |
150 | 150 |
|
151 |
protected float similarity(final Oaf oa, final Oaf ob) {
|
|
151 |
protected double similarity(final Oaf oa, final Oaf ob) {
|
|
152 | 152 |
|
153 | 153 |
final MapDocument a = ProtoDocumentBuilder.newInstance(oa.getEntity().getId(), oa.getEntity(), dedupConf.getPace().getModel()); |
154 | 154 |
final MapDocument b = ProtoDocumentBuilder.newInstance(ob.getEntity().getId(), ob.getEntity(), dedupConf.getPace().getModel()); |
155 | 155 |
|
156 | 156 |
final ScoreResult sr = new PaceDocumentDistance().between(a, b, dedupConf); |
157 |
final float score = (float) Algorithms.scale(sr.getScore(), scaleLB, 1, 0, 1); |
|
157 |
return sr.getScore(); |
|
158 |
} |
|
158 | 159 |
|
160 |
protected float scale(final double d) { |
|
161 |
final float score = (float) Algorithms.scale(d, scaleLB, 1, 0, 1); |
|
162 |
|
|
159 | 163 |
return MathUtils.round(score, SCORE_DECIMALS, BigDecimal.ROUND_HALF_DOWN); |
160 | 164 |
} |
161 | 165 |
|
Also available in: Unified diff
avoid to emit enrichment events when the similarity score is below the threshold