@Override public List<String> getSenses(String sod) throws SenseInventoryException { List<String> senses = new ArrayList<String>(); for (POS pos : POS.values()) { senses.addAll(getSenses(sod, pos)); } return senses; }
@Override public void initialize(UimaContext context) throws ResourceInitializationException { super.initialize(context); uniqueInstances = new HashSet<Pair<String, POS>>(); polysemousInstanceCount = new HashMap<POS, Integer>(); uniquePolysemousInstanceCount = new HashMap<POS, Integer>(); monosemousInstanceCount = new HashMap<POS, Integer>(); uniqueMonosemousInstanceCount = new HashMap<POS, Integer>(); unknownInstanceCount = new HashMap<POS, Integer>(); uniqueUnknownInstanceCount = new HashMap<POS, Integer>(); polysemousSenseCount = new HashMap<POS, Integer>(); uniquePolysemousSenseCount = new HashMap<POS, Integer>(); for (POS pos : POS.values()) { polysemousInstanceCount.put(pos, Integer.valueOf(0)); uniquePolysemousInstanceCount.put(pos, Integer.valueOf(0)); monosemousInstanceCount.put(pos, Integer.valueOf(0)); uniqueMonosemousInstanceCount.put(pos, Integer.valueOf(0)); unknownInstanceCount.put(pos, Integer.valueOf(0)); uniqueUnknownInstanceCount.put(pos, Integer.valueOf(0)); polysemousSenseCount.put(pos, Integer.valueOf(0)); uniquePolysemousSenseCount.put(pos, Integer.valueOf(0)); } }
for (POS pos : POS.values()) { agreement.put(pos, new double[2][2]); clusteredScoreByLemma = new HashMap<String, Double>(); randomClusteredScoreByLemma = new HashMap<String, Double>(); for (POS pos : POS.values()) { clusteredScore.put(pos, Double.valueOf(0.0)); randomClusteredScore.put(pos, Double.valueOf(0.0));
totalScore = new HashMap<POS, Double>(); backoffScore = new HashMap<POS, Double>(); for (POS pos : POS.values()) { testAnnotatedInstances.put(pos, Integer.valueOf(0)); goldAnnotatedInstances.put(pos, Integer.valueOf(0));
"---", "-----", "-----", "-------", "-------", "-------", "------", "--", "---"); for (POS pos : POS.values()) { totalUnknownInstanceCount += unknownInstanceCount.get(pos); totalMonosemousInstanceCount += monosemousInstanceCount.get(pos); "---", "-----", "-----", "-------", "-------", "-------", "------", "--", "---"); for (POS pos : POS.values()) { totalUnknownInstanceCount += uniqueUnknownInstanceCount.get(pos); totalMonosemousInstanceCount += uniqueMonosemousInstanceCount
double totalTotalScore = 0.0; for (POS pos : POS.values()) { Pair<String, POS> algorithmPOS = new Pair<String, POS>( algorithm, pos);
for (POS pos : POS.values()) { totalAgreement[0][0] += agreement.get(pos)[0][0]; totalAgreement[0][1] += agreement.get(pos)[0][1];
for (POS pos : POS.values()) { WSDStats wsdStats = new WSDStats(testAnnotatedInstances.get(pos), bothAnnotatedInstances.get(pos),
for (POS pos : POS.values()) { WSDStats unclusteredWsdStats = new WSDStats( testAnnotatedInstances.get(pos),