public NamedEntities entity_stats() {
		NamedEntities res = new NamedEntities();
		CoreLabel c;
		for (int classifierId = 0; classifierId < classifiers.size(); classifierId++) {
			System.err.printf("-- Classifier-%d\n", classifierId);
			
			String lastGold = "O", lastGuess = "O";
			int goldIndex = 0, guessIndex = 0;
			String goldString = "", guessString = "";
			String goldLemmaString = "", guessLemmaString = "";
			for (int i = 0; i < document.size(); i++) {
				c = document.get(i);
				String gold = c.getString(NamedEntityTagGoldAnnotation.class);
				String guess = c.get(AnswersAnnotation.class).get(classifierId);
				
				// continue current gold string
				if (lastGold.equals(gold) && !lastGold.equals("O")) {
					goldString += " " + c.word();
					goldLemmaString += " " + c.lemma();
				}
				
				// continue current guess string
				if (lastGuess.equals(guess) && !lastGuess.equals("O")) {
					guessString += " " + c.word();
					guessLemmaString += " " + c.lemma();
				}
				
				if (!lastGold.equals(gold) && !lastGold.equals("O")) {
					String t = "|" + lastGold + "|" + lastGuess;
				    if (lastGuess.equals(lastGold) && !lastGuess.equals(guess) &&
				    		goldIndex == guessIndex) {
				    	// TP 0/0 1/1 0/0
				    	//System.err.printf("TP %s\n", goldString);
				    	res.incTp(goldLemmaString + t, goldString + t);
				    } else {
				    	// FN 0/0 1/0 1/0 0/0; 0/0 1/1 1/0 0/0
						//System.err.printf("FN %s\n", goldString);
						res.incFn(goldLemmaString + t, goldString + t);
				    }
				}
				
				if (!lastGuess.equals(guess) && !lastGuess.equals("O")) {
					if (lastGuess.equals(lastGold) && !lastGuess.equals(guess) &&
							goldIndex == guessIndex && !lastGold.equals(gold)) {
						// already TP
					} else {
						// FP 
						String t = "|" + lastGold + "|" + lastGuess;
						res.incFp(guessLemmaString + t, guessString + t);
						System.err.printf("FP %s\n", guessString);
					}
				}
				
				if (!lastGold.equals(gold)) {
					lastGold = gold;
					goldIndex = i;
					goldString = c.word();
					goldLemmaString = c.lemma();
				}

				if (!lastGuess.equals(guess)) {
					lastGuess = guess;
					guessIndex = i;
					guessString = c.word();
					guessLemmaString = c.lemma();
				}
			}
				
			if (!lastGold.equals("O")) {
				String t = "|" + lastGold + "|" + lastGuess;
				if (lastGold.equals(lastGuess) && goldIndex == guessIndex) {
					// System.err.printf("TP %s\n", goldString);
					res.incTp(goldLemmaString + t, goldString + t);
				} else {
					// System.err.printf("FN %s\n", goldString);
					res.incFn(goldLemmaString + t, goldString + t);
				}
			}
			
			if (!lastGuess.equals("O")) {
				if (lastGold.equals(lastGuess) && goldIndex == guessIndex) {
					// OK
				} else {
					String t = "|" + lastGold + "|" + lastGuess;
					res.incFn(guessLemmaString + t, guessString + t);
				}
			}
		}
		return res;
	}
public NamedEntities entity_stats ( ) { NamedEntities res = new NamedEntities ( ) ; CoreLabel c ; for ( int classifierId = 0 ; classifierId < classifiers . size ( ) ; classifierId ++ ) { System . err . printf ( "-- Classifier-%d\n" , classifierId ) ; String lastGold = "O" , lastGuess = "O" ; int goldIndex = 0 , guessIndex = 0 ; String goldString = "" , guessString = "" ; String goldLemmaString = "" , guessLemmaString = "" ; for ( int i = 0 ; i < document . size ( ) ; i ++ ) { c = document . get ( i ) ; String gold = c . getString ( NamedEntityTagGoldAnnotation . class ) ; String guess = c . get ( AnswersAnnotation . class ) . get ( classifierId ) ; if ( lastGold . equals ( gold ) && ! lastGold . equals ( "O" ) ) { goldString += " " + c . word ( ) ; goldLemmaString += " " + c . lemma ( ) ; } if ( lastGuess . equals ( guess ) && ! lastGuess . equals ( "O" ) ) { guessString += " " + c . word ( ) ; guessLemmaString += " " + c . lemma ( ) ; } if ( ! lastGold . equals ( gold ) && ! lastGold . equals ( "O" ) ) { String t = "|" + lastGold + "|" + lastGuess ; if ( lastGuess . equals ( lastGold ) && ! lastGuess . equals ( guess ) && goldIndex == guessIndex ) { res . incTp ( goldLemmaString + t , goldString + t ) ; } else { res . incFn ( goldLemmaString + t , goldString + t ) ; } } if ( ! lastGuess . equals ( guess ) && ! lastGuess . equals ( "O" ) ) { if ( lastGuess . equals ( lastGold ) && ! lastGuess . equals ( guess ) && goldIndex == guessIndex && ! lastGold . equals ( gold ) ) { } else { String t = "|" + lastGold + "|" + lastGuess ; res . incFp ( guessLemmaString + t , guessString + t ) ; System . err . printf ( "FP %s\n" , guessString ) ; } } if ( ! lastGold . equals ( gold ) ) { lastGold = gold ; goldIndex = i ; goldString = c . word ( ) ; goldLemmaString = c . lemma ( ) ; } if ( ! lastGuess . equals ( guess ) ) { lastGuess = guess ; guessIndex = i ; guessString = c . word ( ) ; guessLemmaString = c . lemma ( ) ; } } if ( ! lastGold . equals ( "O" ) ) { String t = "|" + lastGold + "|" + lastGuess ; if ( lastGold . equals ( lastGuess ) && goldIndex == guessIndex ) { res . incTp ( goldLemmaString + t , goldString + t ) ; } else { res . incFn ( goldLemmaString + t , goldString + t ) ; } } if ( ! lastGuess . equals ( "O" ) ) { if ( lastGold . equals ( lastGuess ) && goldIndex == guessIndex ) { } else { String t = "|" + lastGold + "|" + lastGuess ; res . incFn ( guessLemmaString + t , guessString + t ) ; } } } return res ; }
Provides all agregated stats about GOLD and GUESS entities (FP, TP, FP) and their categories
@return