/** * <!-- <init>(Learner,String,boolean) --> Creates a new trainer that doesn't produce status * messages. * * @param l The learner to be trained. * @param p The path to an example file. * @param z Whether or not the example file is compressed. **/ public BatchTrainer(Learner l, String p, boolean z) { this(l, new ArrayFileParser(p, z)); }
/** * <!-- <init>(Learner,String,boolean,int) --> Creates a new trainer that produces status * messages. * * @param l The learner to be trained. * @param p The path to an example file. * @param z Whether or not the example file is compressed. * @param o The number of examples in between status messages on STDOUT. **/ public BatchTrainer(Learner l, String p, boolean z, int o) { this(l, new ArrayFileParser(p, z), o); }
/** * <!-- <init>(Learner,String,boolean,int,String) --> Creates a new trainer that produces status * messages with the specified indentation spacing for status messages. * * @param l The learner to be trained. * @param p The path to an example file. * @param z Whether or not the example file is compressed. * @param o The number of examples in between status messages on STDOUT. * @param i The indentation spacing for status messages. **/ public BatchTrainer(Learner l, String p, boolean z, int o, String i) { this(l, new ArrayFileParser(p, z), o, i); }
new ArrayFileParser(exFilePath, lce.preExtract.value.endsWith("Zip\"")); if (lce.pruneStatus != RevisionAnalysis.UNAFFECTED) learner.readLexiconOnDemand(classDir + getName() + ".lex"); new ArrayFileParser(testExFilePath, lce.preExtract.value.endsWith("Zip\"")); else
public static void main(String[] args) { String exFileName = null; String lexFileName = null; String lcFileName = null; try { exFileName = args[0]; lexFileName = args[1]; lcFileName = args[2]; if (args.length > 3) throw new Exception(); } catch (Exception e) { System.err .println("usage: java edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser <example file> <lexicon file> <lc file>"); System.exit(1); } ArrayFileParser parser = new ArrayFileParser(exFileName); Learner learner = Learner.readLearner(lcFileName); learner.readLexicon(lexFileName); for (Object e = parser.next(); e != null; e = parser.next()) { FeatureVector v = new FeatureVector((Object[]) e, learner.getLexicon(), learner.getLabelLexicon()); v.sort(); System.out.println(v); } } }
parser = new ArrayFileParser(fTempFile.getPath(), zip); else parser = new ArrayFileParser(baos.toByteArray(), zip);
parser = new ArrayFileParser(fTempFile.getPath(), zip); else parser = new ArrayFileParser(baos.toByteArray(), zip);