/** * Takes a {@link List} of documents and prints the likelihood of each * possible label at each point. Also prints probability calibration information over document collection. * * @param documents A {@link List} of {@link List} of something that extends * {@link CoreMap}. */ public void printProbsDocuments(ObjectBank<List<IN>> documents) { Counter<Integer> calibration = new ClassicCounter<>(); Counter<Integer> correctByBin = new ClassicCounter<>(); TwoDimensionalCounter<Integer,String> calibratedTokens = new TwoDimensionalCounter<>(); for (List<IN> doc : documents) { Triple<Counter<Integer>, Counter<Integer>, TwoDimensionalCounter<Integer,String>> triple = printProbsDocument(doc); if (triple != null) { Counters.addInPlace(calibration, triple.first()); Counters.addInPlace(correctByBin, triple.second()); calibratedTokens.addAll(triple.third()); } System.out.println(); } if (calibration.size() > 0) { // we stored stuff, so print it out PrintWriter pw = new PrintWriter(System.err); outputCalibrationInfo(pw, calibration, correctByBin, calibratedTokens); pw.flush(); } }
/** * Takes a {@link List} of documents and prints the likelihood of each * possible label at each point. * * @param documents * A {@link List} of {@link List} of something that extends * {@link CoreMap}. */ public void printProbsDocuments(ObjectBank<List<IN>> documents) { for (List<IN> doc : documents) { printProbsDocument(doc); System.out.println(); } }
/** * Takes a {@link List} of documents and prints the likelihood of each * possible label at each point. * * @param documents * A {@link List} of {@link List} of something that extends * {@link CoreMap}. */ public void printProbsDocuments(ObjectBank<List<IN>> documents) { for (List<IN> doc : documents) { printProbsDocument(doc); System.out.println(); } }
/** * Takes a {@link List} of documents and prints the likelihood of each * possible label at each point. Also prints probability calibration information over document collection. * * @param documents A {@link List} of {@link List} of something that extends * {@link CoreMap}. */ public void printProbsDocuments(ObjectBank<List<IN>> documents) { Counter<Integer> calibration = new ClassicCounter<>(); Counter<Integer> correctByBin = new ClassicCounter<>(); TwoDimensionalCounter<Integer,String> calibratedTokens = new TwoDimensionalCounter<>(); for (List<IN> doc : documents) { Triple<Counter<Integer>, Counter<Integer>, TwoDimensionalCounter<Integer,String>> triple = printProbsDocument(doc); if (triple != null) { Counters.addInPlace(calibration, triple.first()); Counters.addInPlace(correctByBin, triple.second()); calibratedTokens.addAll(triple.third()); } System.out.println(); } if (calibration.size() > 0) { // we stored stuff, so print it out PrintWriter pw = new PrintWriter(System.err); outputCalibrationInfo(pw, calibration, correctByBin, calibratedTokens); pw.flush(); } }