@Override public Vector<Double> calculateScores(JCas cas) throws ScoringComponentException { // all the values: (T&H/H), (T&H/T), and ((T&H/H)*(T&H/T)) Vector<Double> scoresVector = new Vector<Double>(); try { this.aligner.annotate(cas); JCas tView = cas.getView(LAP_ImplBase.TEXTVIEW); JCas hView = cas.getView(LAP_ImplBase.HYPOTHESISVIEW); if (null != tView && null != hView) { scoresVector.addAll(calculateSimilarity(tView, hView)); } String task = JCasUtil.select(cas, EntailmentMetadata.class) .iterator().next().getTask(); if (null == task) { scoresVector.add(0d); scoresVector.add(0d); scoresVector.add(0d); scoresVector.add(0d); } else { scoresVector.add(NemexScorerUtility.isTaskIE(task)); scoresVector.add(NemexScorerUtility.isTaskIR(task)); scoresVector.add(NemexScorerUtility.isTaskQA(task)); scoresVector.add(NemexScorerUtility.isTaskSUM(task)); } } catch (PairAnnotatorComponentException | CASException e) { throw new ScoringComponentException(e.getMessage()); } return scoresVector; }
@Override public Vector<Double> calculateScores(JCas cas) throws ScoringComponentException { // all the values: (T&H/H), (T&H/T), and ((T&H/H)*(T&H/T)) Vector<Double> scoresVector = new Vector<Double>(); try { this.aligner.annotate(cas); JCas tView = cas.getView(LAP_ImplBase.TEXTVIEW); JCas hView = cas.getView(LAP_ImplBase.HYPOTHESISVIEW); if (null != tView && null != hView) { scoresVector.addAll(calculateSimilarity(tView, hView)); } String task = JCasUtil.select(cas, EntailmentMetadata.class) .iterator().next().getTask(); if (null == task) { scoresVector.add(0d); scoresVector.add(0d); scoresVector.add(0d); scoresVector.add(0d); } else { scoresVector.add(NemexScorerUtility.isTaskIE(task)); scoresVector.add(NemexScorerUtility.isTaskIR(task)); scoresVector.add(NemexScorerUtility.isTaskQA(task)); scoresVector.add(NemexScorerUtility.isTaskSUM(task)); } } catch (PairAnnotatorComponentException | CASException e) { throw new ScoringComponentException(e.getMessage()); } return scoresVector; }
@Override public Vector<Double> calculateScores(JCas cas) throws ScoringComponentException { // all the values: (T&H/H), (T&H/T), and ((T&H/H)*(T&H/T)) Vector<Double> scoresVector = new Vector<Double>(); try { this.aligner.annotate(cas); JCas tView = cas.getView(LAP_ImplBase.TEXTVIEW); JCas hView = cas.getView(LAP_ImplBase.HYPOTHESISVIEW); if (null != tView && null != hView) { scoresVector.addAll(calculateSimilarity(tView, hView)); } String task = JCasUtil.select(cas, EntailmentMetadata.class) .iterator().next().getTask(); if (null == task) { scoresVector.add(0d); scoresVector.add(0d); scoresVector.add(0d); scoresVector.add(0d); } else { scoresVector.add(NemexScorerUtility.isTaskIE(task)); scoresVector.add(NemexScorerUtility.isTaskIR(task)); scoresVector.add(NemexScorerUtility.isTaskQA(task)); scoresVector.add(NemexScorerUtility.isTaskSUM(task)); } } catch (PairAnnotatorComponentException | CASException e) { throw new ScoringComponentException(e.getMessage()); } return scoresVector; }
@Override public Vector<Double> calculateScores(JCas cas) throws ScoringComponentException { // all the values: (T&H/H), (T&H/T), and ((T&H/H)*(T&H/T)) Vector<Double> scoresVector = new Vector<Double>(); try { JCas tView = cas.getView("TextView"); HashMap<String, Integer> tBag = countTokens(tView); JCas hView = cas.getView("HypothesisView"); HashMap<String, Integer> hBag = countTokens(hView); scoresVector.addAll(calculateSimilarity(tBag, hBag)); String task = JCasUtil.select(cas, EntailmentMetadata.class).iterator().next().getTask(); if (null == task) { scoresVector.add(0d); scoresVector.add(0d); scoresVector.add(0d); scoresVector.add(0d); } else { scoresVector.add(isTaskIE(task)); scoresVector.add(isTaskIR(task)); scoresVector.add(isTaskQA(task)); scoresVector.add(isTaskSUM(task)); } } catch (CASException e) { throw new ScoringComponentException(e.getMessage()); } return scoresVector; }
aOut.printf("Language:%s\nTask:%s\n", m.getLanguage(), m.getTask()); aOut.printf("Origin:%s\nChannel:%s\n", m.getOrigin(), m.getChannel()); aOut.printf("TextDocumentID:%s\nTextCollectionID:%s\n", m.getTextDocumentID(), m.getTextCollectionID());