From: Jason B. <jas...@us...> - 2002-04-25 15:08:06
|
Update of /cvsroot/maxent/maxent/src/java/opennlp/maxent In directory usw-pr-cvs1:/tmp/cvs-serv23879/src/java/opennlp/maxent Modified Files: TrainEval.java Log Message: Added usage message to TrainEval's eval() method. Index: TrainEval.java =================================================================== RCS file: /cvsroot/maxent/maxent/src/java/opennlp/maxent/TrainEval.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TrainEval.java 14 Nov 2001 17:39:56 -0000 1.2 --- TrainEval.java 25 Apr 2002 15:01:07 -0000 1.3 *************** *** 96,115 **** } } ! FileReader datafr = new FileReader(args[g.getOptind()]); ! ! if(train) { MaxentModel m = train(new EventCollectorAsStream(e.getEventCollector(datafr)), cutoff); ! new BinaryGISModelWriter((GISModel)m, new File(dir+stem)).persist(); } else { MaxentModel model = ! new BinaryGISModelReader(new File(dir+stem)).getModel(); ! if(local) e.localEval(model, datafr, e, verbose); ! else eval(model, datafr, e, verbose); } } --- 96,139 ---- } } + + int lastIndex = g.getOptind(); + if (lastIndex >= args.length) { + System.out.println("This is a usage message from opennlp.maxent.TrainEval. You have called the training procedure for a maxent application with the incorrect arguments. These are the options:"); + + System.out.println("\nOptions for defining the model location and name:"); + System.out.println(" -d <directoryName>"); + System.out.println("\tThe directory in which to store the model."); + System.out.println(" -s <modelName>"); + System.out.println("\tThe name of the model, e.g. EnglishPOS.bin.gz or NameFinder.txt."); + + System.out.println("\nOptions for training:"); + System.out.println(" -c <cutoff>"); + System.out.println("\tAn integer cutoff level to reduce infrequent contextual predicates."); + System.out.println(" -t\tTrain a model. If absent, the given model will be loaded and evaluated."); + System.out.println("\nOptions for evaluation:"); + System.out.println(" -l\t the evaluation method of class that uses the model. If absent, TrainEval's eval method is used."); + System.out.println(" -v\t verbose."); + System.out.println("\nThe final argument is the data file to be loaded and used for either training or evaluation."); + System.out.println("\nAs an example for training:\n java opennlp.grok.preprocess.postag.POSTaggerME -t -d ./ -s EnglishPOS.bin.gz -c 7 postag.data"); + System.exit(0); + } + + FileReader datafr = new FileReader(args[lastIndex]); ! if (train) { MaxentModel m = train(new EventCollectorAsStream(e.getEventCollector(datafr)), cutoff); ! new SuffixSensitiveGISModelWriter((GISModel)m, ! new File(dir+stem)).persist(); } else { MaxentModel model = ! new SuffixSensitiveGISModelReader(new File(dir+stem)).getModel(); ! if (local) { e.localEval(model, datafr, e, verbose); ! } else { eval(model, datafr, e, verbose); + } } } |