&& (splitPolicy == SplitPolicy.sequential || splitPolicy == SplitPolicy.random)) { ++examples; for (Object example = parser.next(); example != null; example = parser.next()) if (example != FoldSeparator.separator) ++examples; parser.reset(); for (Object example = parser.next(); example != null; example = parser.next()) if (example == FoldSeparator.separator) ++this.K; parser.reset();
/** * Frees any resources this parser may be holding. */ public void close() { parser.close(); } }
/** * Returns the next array of {@link Word}s. * * @return The next {@link LinkedVector} of {@link Word}s parsed, or * <code>null</code> if there are no more children in the stream. **/ public Object next() { return convert((String[]) parser.next()); }
/** * Sets this parser back to the beginning of the raw data. */ public void reset() { parser.reset(); }
((ArrayFileParser) parser).setIncludePruned(true); for (Object example = parser.next(); example != null; example = parser.next()) { if (progressOutput > 0 && examples % progressOutput == 0) System.out.println(" " + learner.name + ", pre-extract: " + messageIndent + " examples at " + new Date()); parser.close(); eos.close();
/** * Returns {@link edu.illinois.cs.cogcomp.lbjava.parse.LinkedVector}s of {@link Word} objects one at * a time. **/ public Object next() { Sentence sentence = (Sentence) parser.next(); if (sentence == null) return null; return sentence.wordSplit(); }
/** Sets this parser back to the beginning of the raw data. */ public void reset() { parser.reset(); next = null; }
/** * Trains the chunker models with the specified training data * * @param parser Parser for the training data. Initialized in trainModels(String trainingData) */ public void trainModelsWithParser(Parser parser) { Chunker.isTraining = true; // Run the learner for (int i = 1; i <= iter; i++) { LinkedVector ex; while ((ex = (LinkedVector) parser.next()) != null) { for (int j = 0; j < ex.size(); j++) { chunker.learn(ex.get(j)); } } parser.reset(); chunker.doneWithRound(); logger.info("Iteration number : " + i); } chunker.doneLearning(); }
/** * Returns the next array of {@link Word}s. * * @return The next {@link LinkedVector} of {@link Word}s parsed, or * <code>null</code> if there are no more children in the stream. **/ public Object next() { return convert((String[]) parser.next()); }
/** * Sets this parser back to the beginning of the raw data. */ public void reset() { parser.reset(); next = null; }
/** * Frees any resources this parser may be holding. */ public void close() { parser.close(); } }
/** * Returns {@link edu.illinois.cs.cogcomp.lbjava.parse.LinkedVector}s of {@link Word} objects one at * a time. **/ public Object next() { Sentence sentence = (Sentence) parser.next(); if (sentence == null) return null; return sentence.wordSplit(); }
/** * Sets this parser back to the beginning of the raw data. */ public void reset() { parser.reset(); }
/** * Frees any resources this parser may be holding. */ public void close() { parser.close(); } }
while ((ex = trainingParser.next()) != null) { baselineTarget.learn(ex); mikheevTable.learn(ex); trainingParser.reset(); while ((ex = trainingParser.next()) != null) { taggerKnown.learn(ex); while ((ex = trainingParserUnknown.next()) != null) { taggerUnknown.learn(ex); trainingParser.reset(); trainingParserUnknown.reset(); taggerKnown.doneWithRound(); taggerUnknown.doneWithRound();
/** * Returns the next {@link LinkedVector} of {@link Token}s. * * @return The next {@link LinkedVector} of {@link Token}s parsed, or * <code>null</code> if there are no more children in the stream. **/ public Object next() { return convert((LinkedVector) parser.next()); }
/** * Sets this parser back to the beginning of the raw data. */ public void reset() { parser.reset(); next = null; }
/** * Frees any resources this parser may be holding. */ public void close() { parser.close(); } }
train_parser.reset(); BatchTrainer trainer = new BatchTrainer(classifier, train_parser); String modelFileName = ""; classifier.setLexicon(lexicon); int examples = 0; for (Object example = train_parser.next(); example != null; example = train_parser.next()){ examples ++; train_parser.reset(); classifier.initialize(examples, preExtractLearner.getLexicon().size()); for (Object example = train_parser.next(); example != null; example = train_parser.next()){ classifier.learn(example); train_parser.reset(); classifier.doneWithRound(); classifier.doneLearning();