public static String getSemanticCompatibilityFeature(MentionContext ec, DiscourseEntity de, TestSimilarityModel simModel) { if (simModel != null) { double best = 0; for (Iterator<MentionContext> xi = de.getMentions(); xi.hasNext();) { MentionContext ec2 = xi.next(); double sim = simModel.compatible(ec, ec2); if (sim > best) { best = sim; } } if (best > MIN_SIM_PROB) { return SIM_COMPATIBLE; } else if (best > (1 - MIN_SIM_PROB)) { return SIM_UNKNOWN; } else { return SIM_INCOMPATIBLE; } } else { System.err.println("MaxentResolver: Uninitialized Semantic Model"); return SIM_UNKNOWN; } }
public static String getSemanticCompatibilityFeature(MentionContext ec, DiscourseEntity de, TestSimilarityModel simModel) { if (simModel != null) { double best = 0; for (Iterator<MentionContext> xi = de.getMentions(); xi.hasNext();) { MentionContext ec2 = xi.next(); double sim = simModel.compatible(ec, ec2); if (sim > best) { best = sim; } } if (best > MIN_SIM_PROB) { return SIM_COMPATIBLE; } else if (best > (1 - MIN_SIM_PROB)) { return SIM_UNKNOWN; } else { return SIM_INCOMPATIBLE; } } else { System.err.println("MaxentResolver: Uninitialized Semantic Model"); return SIM_UNKNOWN; } }