@Override protected Map<String, Double> getDisambiguation(JCas aJCas, WSDItem wsdItem) throws SenseInventoryException { return wsdMethod.getDisambiguation( wsdItem.getSubjectOfDisambiguation(), POS.valueOf(wsdItem.getPos())); }
@Override protected Map<WSDItem, Map<String, Double>> getDisambiguation( Collection<WSDItem> wsdItems) throws SenseInventoryException { List<Pair<String, POS>> subjectsOfDisambiguation = new ArrayList<Pair<String, POS>>(); for (WSDItem wsdItem : wsdItems) { subjectsOfDisambiguation.add(new Pair<String, POS>(wsdItem .getSubjectOfDisambiguation(), POS.valueOf(wsdItem.getPos()))); } Map<Pair<String, POS>, Map<String, Double>> resultsByToken = wsdMethod .getDisambiguation(subjectsOfDisambiguation); Map<WSDItem, Map<String, Double>> resultsByWSDItem = new HashMap<WSDItem, Map<String, Double>>(); for (WSDItem wsdItem : wsdItems) { Pair<String, POS> p = new Pair<String, POS>(wsdItem.getSubjectOfDisambiguation(), POS.valueOf(wsdItem.getPos())); Map<String, Double> senseMap = resultsByToken.get(p); if (senseMap != null) { resultsByWSDItem.put(wsdItem, senseMap); } } return resultsByWSDItem; }
POS pos = wsdItem.getPos() == null ? null : POS.valueOf(wsdItem .getPos()); String sodPos = sod + "/" + pos;
@Override protected Map<String, Double> getDisambiguation(JCas aJCas, WSDItem wsdItem, Annotation context) throws SenseInventoryException { // TODO: Currently this just passes the covered text as the context. // It might be better to pass a collection of annotations (for example, // lemmas) return wsdMethod.getDisambiguation( wsdItem.getSubjectOfDisambiguation(), POS.valueOf(wsdItem.getPos()), context.getCoveredText()); }
POS pos = wsdItem.getPos() == null ? null : POS.valueOf(wsdItem .getPos());
throws SenseInventoryException POS pos = wsdItem.getPos() == null ? null : POS.valueOf(wsdItem .getPos()); int numberOfCorrectSenses = goldResult.getSenses().size();
POS pos = wsdItem.getPos() == null ? null : POS.valueOf(wsdItem .getPos()); WSDResult goldResult = null;
- randomClusteredWsdStats.f1)); double[][] matrix = pos.equals("all") ? totalAgreement : agreement .get(POS.valueOf(pos)); double mcnemar = ConfusionMatrix.mcnemar(matrix, mcnemarCorrection); if (Double.isInfinite(mcnemar)) {
break; POS pos = wsdItem.getPos() == null ? null : POS.valueOf(wsdItem .getPos()); WSDResult goldResult = null;
break; POS pos = wsdItem.getPos() == null ? null : POS.valueOf(wsdItem .getPos());
POS pos = POS.valueOf(wsdItem.getPos()); String sod = wsdItem.getSubjectOfDisambiguation(); int senseCount;