congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Train
Code IndexAdd Tabnine to your IDE (free)

How to use
Train
in
org.cleartk.ml.jar

Best Java code snippets using org.cleartk.ml.jar.Train (Showing top 8 results out of 315)

origin: ClearTK/cleartk

public static void main(String... args) throws Exception {
 String programName = Train.class.getName();
 String usage = String.format("usage: java %s DIR\n\n"
   + "The directory DIR should contain the training-data.xxx file as\n"
   + "created by a classifier DataWriter\n", programName);
 // usage message for wrong number of arguments
 if (args.length < 1) {
  System.err.format("error: wrong number of arguments\n%s", usage);
  System.exit(1);
 }
 // parse out the training directory from the arguments
 File dir = new File(args[0]);
 String[] remainingArgs = new String[args.length - 1];
 System.arraycopy(args, 1, remainingArgs, 0, remainingArgs.length);
 // train and package the classifier
 Train.main(dir, remainingArgs);
}
origin: ClearTK/cleartk

@Override
public void trainClassifier(File dir, String... args) throws Exception {
 String[] delegatedArgs = new String[args.length + 1];
 System.arraycopy(args, 0, delegatedArgs, 1, args.length);
 delegatedArgs[0] = this.getDelegatedModelDirectory(dir).getPath();
 Train.main(delegatedArgs);
}
origin: ClearTK/cleartk

public void train(File directory, Model.Params params) throws Exception {
 Train.main(this.getModelDirectory(directory, params), params.trainingArguments);
}

origin: ClearTK/cleartk

@Override
public void train(CollectionReader collectionReader, File outputDirectory) throws Exception {
 // assemble the training pipeline
 AggregateBuilder aggregate = new AggregateBuilder();
 // an annotator that loads the text from the training file URIs
 aggregate.add(UriToDocumentTextAnnotator.getDescription());
 // an annotator that parses and loads MASC named entity annotations (and tokens)
 aggregate.add(MascGoldAnnotator.getDescription());
 // an annotator that adds part-of-speech tags
 aggregate.add(PosTaggerAnnotator.getDescription());
 // our NamedEntityChunker annotator, configured to write Mallet CRF training data
 aggregate.add(AnalysisEngineFactory.createEngineDescription(
   NamedEntityChunker.class,
   CleartkSequenceAnnotator.PARAM_IS_TRAINING,
   true,
   DirectoryDataWriterFactory.PARAM_OUTPUT_DIRECTORY,
   outputDirectory,
   DefaultSequenceDataWriterFactory.PARAM_DATA_WRITER_CLASS_NAME,
   MalletCrfStringOutcomeDataWriter.class));
 // run the pipeline over the training corpus
 SimplePipeline.runPipeline(collectionReader, aggregate.createAggregateDescription());
 // quiet Mallet down a bit (but still leave likelihoods so you can see progress)
 Logger malletLogger = Logger.getLogger("cc.mallet");
 malletLogger.setLevel(Level.WARNING);
 Logger likelihoodLogger = Logger.getLogger("cc.mallet.fst.CRFOptimizableByLabelLikelihood");
 likelihoodLogger.setLevel(Level.INFO);
 // train a Mallet CRF model on the training data
 Train.main(outputDirectory);
}
origin: ClearTK/cleartk

Train.main(outputDirectory);
origin: org.apache.ctakes/ctakes-assertion

org.cleartk.ml.jar.Train.main(args);
logger.info("finished training.");
hider.restoreOutput();
origin: apache/ctakes

org.cleartk.ml.jar.Train.main(args);
logger.info("finished training.");
hider.restoreOutput();
origin: ClearTK/cleartk

public static void main(String[] args) throws Exception {
 Options options = CliFactory.parseArguments(Options.class, args);
 // a reader that loads the URIs of the training files
 CollectionReaderDescription reader = UriCollectionReader.getDescriptionFromDirectory(
   options.getTrainDirectory(),
   MascTextFileFilter.class,
   null);
 // assemble the training pipeline
 AggregateBuilder aggregate = new AggregateBuilder();
 // an annotator that loads the text from the training file URIs
 aggregate.add(UriToDocumentTextAnnotator.getDescription());
 // an annotator that parses and loads MASC named entity annotations (and tokens)
 aggregate.add(MascGoldAnnotator.getDescription());
 // an annotator that adds part-of-speech tags (so we can use them for features)
 aggregate.add(PosTaggerAnnotator.getDescription());
 // our NamedEntityChunker annotator, configured to write Mallet CRF training data
 aggregate.add(AnalysisEngineFactory.createEngineDescription(
   NamedEntityChunker.class,
   CleartkSequenceAnnotator.PARAM_IS_TRAINING,
   true,
   DirectoryDataWriterFactory.PARAM_OUTPUT_DIRECTORY,
   options.getModelDirectory(),
   DefaultSequenceDataWriterFactory.PARAM_DATA_WRITER_CLASS_NAME,
   MalletCrfStringOutcomeDataWriter.class));
 // run the pipeline over the training corpus
 SimplePipeline.runPipeline(reader, aggregate.createAggregateDescription());
 // train a Mallet CRF model on the training data
 Train.main(options.getModelDirectory());
}
org.cleartk.ml.jarTrain

Javadoc

Command line tool for training a classifier from an output directory that has been filled by a DirectoryDataWriter. Usage: java org.cleartk.ml.jar.Train model-dir ... Some classifiers may accept additional arguments to train, see the documentation for the various JarClassifierBuilder subclasses for details.
Copyright (c) 2007-2011, Regents of the University of Colorado
All rights reserved.

Most used methods

  • main

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now