String goldAnswer = pair.getGoldAnswer(); features.put(Integer.parseInt(pair.getPairID()), scores); goldAnswers.put(Integer.parseInt(pair.getPairID()), goldAnswer); trainGoldAnswers.add(goldAnswer);
/** * @param aCas * the <code>JCas</code> object * @return return whether it is an identical pair or not */ protected final boolean isIdenticalPair(JCas aCas) { FSIterator<TOP> iter = aCas.getJFSIndexRepository().getAllIndexedFS( Pair.type); if (iter.hasNext()) { Pair p = (Pair) iter.next(); String text = p.getText().getCoveredText(); String hypothesis = p.getHypothesis().getCoveredText(); if (text.trim().equals(hypothesis.trim())) { return true; } } // empty pair return false; }
logger.info("processing pair: " + pair.getPairID() + "\n" + "Text: " + pair.getText().getCoveredText() + "\n" + "Hypothesis: " + pair.getHypothesis().getCoveredText()); String goldAnswer = pair.getGoldAnswer(); //get gold annotation
/** * Returns the pair ID from a JCas created by an EOP LAP. * @param jcas * @return */ public static String getPairIdFromCas(JCas jcas) { Pair pairAnno = JCasUtil.selectSingle(jcas, Pair.class); return pairAnno.getPairID(); } }
/** * @param aCas the <code>JCas</code> object * * @return if the T-H pair contains the gold answer, return it; otherwise return null */ private String getGoldLabel(JCas aCas) { FSIterator<TOP> pairIter = aCas.getJFSIndexRepository() .getAllIndexedFS(Pair.type); Pair p = (Pair) pairIter.next(); if (null == p.getGoldAnswer() || p.getGoldAnswer().equals("") || p.getGoldAnswer().equals("ABSTAIN")) { return null; } else { return p.getGoldAnswer(); } }
Pair p = new Pair(aJCas); p.setText(t); // points T & H p.setHypothesis(h); p.setPairID(pairId); p.setGoldAnswer(goldAnswer.toUpperCase()); p.addToIndexes();
logger.info("processing pair: " + pair.getPairID() + "\n" + "Text: " + pair.getText().getCoveredText() + "\n" + "Hypothesis: " + pair.getHypothesis().getCoveredText()); String goldAnswer = pair.getGoldAnswer(); //get gold annotation return new EditDistanceTEDecision(decisionLabel, pair.getPairID(), confidence);
/** * @param aCas * the <code>JCas</code> object * @return return the pairID of the T-H pair */ protected final String getPairID(JCas aCas) { FSIterator<TOP> pairIter = aCas.getJFSIndexRepository() .getAllIndexedFS(Pair.type); Pair p = (Pair) pairIter.next(); return p.getPairID(); }
/** * @param aCas * input T-H pair * @return if the pair contains the gold answer, return it; otherwise, * return null */ protected String getGoldLabel(JCas aCas) { FSIterator<TOP> pairIter = aCas.getJFSIndexRepository() .getAllIndexedFS(Pair.type); Pair p = (Pair) pairIter.next(); if (null == p.getGoldAnswer() || p.getGoldAnswer().equals("") || p.getGoldAnswer().equals("ABSTAIN")) { return null; } else { return p.getGoldAnswer(); } }
Pair p = new Pair(aJCas); p.setText(tAnnot); // points T & H p.setHypothesis(hAnnot); p.setPairID(null); p.addToIndexes();
Text textAnno = pairAnno.getText(); Hypothesis hypothesisAnno = pairAnno.getHypothesis(); JCas textView = jcas.getView(LAP_ImplBase.TEXTVIEW); JCas hypothesisView = jcas.getView(LAP_ImplBase.HYPOTHESISVIEW); String stringID = pairAnno.getPairID(); try { id = Integer.valueOf(stringID); String goldString = pairAnno.getGoldAnswer(); if (goldString != null) { DecisionLabel goldDecision = DecisionLabel.getLabelFor(goldString);
logger.debug("processing pair "+pair.getPairID()); int pairID = Integer.parseInt(pair.getPairID()); String goldAnswer = pair.getGoldAnswer(); //get gold annotation logger.debug("gold answer: "+goldAnswer);
/** * @param aCas * the <code>JCas</code> object * @return return the pairID of the T-H pair */ protected final String getPairID(JCas aCas) { FSIterator<TOP> pairIter = aCas.getJFSIndexRepository() .getAllIndexedFS(Pair.type); Pair p = (Pair) pairIter.next(); return p.getPairID(); }
/** * @param aCas * the <code>JCas</code> object * @return if the T-H pair contains the gold answer, return it; otherwise, * return null */ public static String getGoldLabel(JCas aCas) { FSIterator<TOP> pairIter = aCas.getJFSIndexRepository() .getAllIndexedFS(Pair.type); Pair p = (Pair) pairIter.next(); if (null == p.getGoldAnswer() || p.getGoldAnswer().equals("") || p.getGoldAnswer().equals("ABSTAIN")) { return null; } else { return p.getGoldAnswer(); } }
/** * @param aCas * the <code>JCas</code> object * @return return whether it is an identical pair or not */ protected final boolean isIdenticalPair(JCas aCas) { FSIterator<TOP> iter = aCas.getJFSIndexRepository().getAllIndexedFS( Pair.type); if (iter.hasNext()) { Pair p = (Pair) iter.next(); String text = p.getText().getCoveredText(); String hypothesis = p.getHypothesis().getCoveredText(); if (text.trim().equals(hypothesis.trim())) { return true; } } // empty pair return false; }
if (aOut != null) aOut.printf("PairID: %s\n", p.getPairID()); aOut.printf("GoldAnswer: %s\n", p.getGoldAnswer()); text = p.getText().getCoveredText(); hypothesis = p.getHypothesis().getCoveredText();
int pairID = Integer.parseInt(pair.getPairID()); logger.debug("processing pair "+pairID); String goldAnswer = pair.getGoldAnswer(); //get gold annotation logger.debug("gold answer: "+goldAnswer);
/** * @param aCas * input T-H pair * @return return the pairID of the pair */ protected String getPairID(JCas aCas) { FSIterator<TOP> pairIter = aCas.getJFSIndexRepository() .getAllIndexedFS(Pair.type); Pair p = (Pair) pairIter.next(); return p.getPairID(); }
/** * @param aCas * the <code>JCas</code> object * @return if the T-H pair contains the gold answer, return it; otherwise, * return null */ protected final String getGoldLabel(JCas aCas) { FSIterator<TOP> pairIter = aCas.getJFSIndexRepository() .getAllIndexedFS(Pair.type); Pair p = (Pair) pairIter.next(); if (null == p.getGoldAnswer() || p.getGoldAnswer().equals("") || p.getGoldAnswer().equals("ABSTAIN")) { return null; } else { return p.getGoldAnswer(); } }
int pairID = Integer.parseInt(pair.getPairID()); DecisionLabel goldAnswer = null; try { goldAnswer = DecisionLabel.getLabelFor(pair.getGoldAnswer()); } catch (EDAException e) { e.printStackTrace();