Codota Logo
Train
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
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

  • Updating database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • compareTo (BigDecimal)
  • onCreateOptionsMenu (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Menu (java.awt)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now