/** * determines best lexical level match of two arrays of Name Entity using * NESim. * * @param ne1_ * @param ne2_ * @return * @throws Exception */ public Alignment<String> alignNEStringArrays(String[] ne1_, String[] ne2_) throws Exception { return neAligner.align(ne1_, ne2_); }
private void initialize(ResourceManager rm_, Comparator<String, EntailmentResult> comparator) throws IOException { ResourceManager fullRm = new SimConfigurator().getConfig(rm_); double threshold = fullRm.getDouble(SimConfigurator.LLM_ENTAILMENT_THRESHOLD.key); tokenizer = new IllinoisTokenizer(); this.comparator = comparator; filter = new WordListFilter(fullRm); neAligner = new Aligner<String, EntailmentResult>(new NEComparator(), filter); aligner = new Aligner<String, EntailmentResult>(comparator, filter); scorer = new GreedyAlignmentScorer<String>(threshold); }
/** * allows client to access aligner used by this comparator * * @param specific_ * @param general_ * @return * @throws Exception */ public Alignment< T > alignArrays( T[] specific_, T[] general_ ) throws Exception { return aligner.align( specific_, general_ ); }
/** * allows client to access aligner used by this comparator * * @param specific_ * @param general_ * @return * @throws Exception */ public Alignment< T > alignArrays( T[] specific_, T[] general_ ) throws Exception { return aligner.align( specific_, general_ ); }
/** * generate a lexical alignment using the comparator specified at * construction, and the * * * @param textTokens_ * @param hypTokens_ * @return * @throws Exception */ public Alignment<String> alignStringArrays(String[] textTokens_, String[] hypTokens_) throws Exception { return aligner.align(textTokens_, hypTokens_); }
@Override public R compare( T[] specific_, T[] general_) throws Exception { Alignment< T > alignment = aligner.align( specific_, general_ ); R result = scorer.scoreAlignment( alignment ); return result; }
@Override public R compare( T[] specific_, T[] general_) throws Exception { Alignment< T > alignment = aligner.align( specific_, general_ ); R result = scorer.scoreAlignment( alignment ); return result; }