Codota Logo
Train.main
Code IndexAdd Codota to your IDE (free)

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

Best Java code snippets using org.cleartk.ml.jar.Train.main (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.jarTrainmain

Javadoc

Trains a classifier in the given directory. The directory should already contain training data as written by a DataWriter or SequenceDataWriter.

Popular methods of Train

    Popular in Java

    • Making http post requests using okhttp
    • putExtra (Intent)
    • orElseThrow (Optional)
    • getOriginalFilename (MultipartFile)
      Return the original filename in the client's filesystem.This may contain path information depending
    • FlowLayout (java.awt)
      A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
    • BufferedWriter (java.io)
      Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
    • SocketTimeoutException (java.net)
      This exception is thrown when a timeout expired on a socket read or accept operation.
    • DateFormat (java.text)
      Formats or parses dates and times.This class provides factories for obtaining instances configured f
    • Iterator (java.util)
      An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
    • Stream (java.util.stream)
      A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
    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