.get(); Redwood.log(ConstantsAndVariables.extremedebug, "Pattern " + pattern + " extracted phrases " + result.first()); wordsandLemmaPatExtracted.addAll(result.first()); matchedTokensByPat.addAll(result.second()); alreadyLabeledWords.addAll(result.third());
/** * 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(); } }
terms.addAll(en, wordsPatExtracted.getCounter(en));
Pair<TwoDimensionalCounter<Pair<String, String>, SurfacePattern>, CollectionValuedMap<SurfacePattern, Triple<String, Integer, Integer>>> result = future .get(); wordsandLemmaPatExtracted.addAll(result.first()); matchedTokensByPat.addAll(result.second()); }catch(Exception e){
.get(); Redwood.log(ConstantsAndVariables.extremedebug, "Pattern " + pattern + " extracted phrases " + result.first()); wordsandLemmaPatExtracted.addAll(result.first()); matchedTokensByPat.addAll(result.second()); alreadyLabeledWords.addAll(result.third());
/** * 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(); } }
terms.addAll(en, wordsPatExtracted.getCounter(en));