Package com.martiansoftware.jsap

Examples of com.martiansoftware.jsap.FlaggedOption


    
    UnflaggedOption opt2a = new UnflaggedOption("outLDAIndex").setStringParser(
          JSAP.STRING_PARSER).setRequired(true);
    opt2a.setHelp("The output directory for the resultant LDA index");
    
     FlaggedOption opt3 = new FlaggedOption("fileCodes")
     .setStringParser(JSAP.STRING_PARSER)
         .setRequired(false)
         .setLongFlag("fileCodes");
     opt2.setHelp("A file containing a mapping between filenames and some key. " +
             "If specified, the query results will list the key instead of the filename.");
    
     Switch sw0 = new Switch("help")
         .setDefault("false")
         .setLongFlag("help");
     sw0.setHelp("Prints this message.");
    
     FlaggedOption opt4 = new FlaggedOption("numK")
     .setStringParser(JSAP.INTEGER_PARSER)
         .setRequired(false)
         .setDefault("50")
         .setLongFlag("numK");
    opt4.setHelp("Number of topics to run.");
    
    jsap.registerParameter(sw0);
    jsap.registerParameter(opt1);
    jsap.registerParameter(opt2);
    jsap.registerParameter(opt2a);
View Full Code Here


    UnflaggedOption opt2 = new UnflaggedOption("resultsDir").setStringParser(
        JSAP.STRING_PARSER).setRequired(true);
    opt2.setHelp("The output directory for the results of each query: one file per original query in queryDirName.");

    FlaggedOption opt3 = new FlaggedOption("weightingCode")
        .setStringParser(JSAP.INTEGER_PARSER).setRequired(false)
        .setLongFlag("weightingCode").setDefault("1");
    opt3.setHelp("An integer code that specifies the term weighting option that should be used. "
        + "1=Linear, 2=Sublinear, 3=Boolean.");
   
    FlaggedOption opt4 = new FlaggedOption("scoringCode")
    .setStringParser(JSAP.INTEGER_PARSER).setRequired(false)
    .setLongFlag("scoringCode").setDefault("1");
    opt4.setHelp("An integer code that specifies the scoring metric that should be used. "
    + "1=Cosine, 2=Overlap.");

    Switch sw0 = new Switch("help").setDefault("false").setLongFlag("help");
    sw0.setHelp("Prints this message.");
View Full Code Here

    UnflaggedOption opt2 = new UnflaggedOption("resultsDir").setStringParser(
        JSAP.STRING_PARSER).setRequired(true);
    opt2.setHelp("The output directory for the results of each query: one file per original query in queryDirName.");

    FlaggedOption opt3 = new FlaggedOption("K")
        .setStringParser(JSAP.INTEGER_PARSER).setRequired(false)
        .setLongFlag("K").setDefault("0");
    opt3.setHelp("If multiple LDA configuration were run (i.e., multiple Ks), then specify which one to use."
        + "Default: the lowest K.");
   
    FlaggedOption opt4 = new FlaggedOption("scoringCode")
    .setStringParser(JSAP.INTEGER_PARSER).setRequired(false)
    .setLongFlag("scoringCode").setDefault("1");
    opt4.setHelp("An integer code that specifies the scoring metric that should be used. "
    + "1=conditional probability.");

    Switch sw0 = new Switch("help").setDefault("false").setLongFlag("help");
    sw0.setHelp("Prints this message.");
View Full Code Here

    final SimpleJSAP jsap = new SimpleJSAP(ClusterSequences.class.getName(),
        "Parses input sequences to do clustering on them. Input sequences should have one sequence per line. "
            + "Each sequence is a tab-separated list of symbols.", new Parameter[] {
            new Switch("verbose", 'v', "verbose", "Set verbose output"),
            new FlaggedOption("taxonomy-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 't', "taxonomy-file",
                "File containing the description of the taxonomy."),
            new FlaggedOption("clusters", JSAP.INTEGER_PARSER, Integer.toString(DEFAULT_CLUSTERS), JSAP.NOT_REQUIRED, 'c', "clusters",
                "Number of clusters to use."),
            new FlaggedOption("passes", JSAP.INTEGER_PARSER, Integer.toString(DEFAULT_PASSES), JSAP.NOT_REQUIRED, 'p', "passes",
                "Number of passes of the algorithm to do."),

            new Switch("init-all-leaves", 'l', "init-all-leaves", "Initial model states are all leaves from taxonomy."),
            new FlaggedOption("init-all-level", JSAP.INTEGER_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'e', "init-all-level",
                "Initial model states are leaves or internal nodes at level <= x."),
            new FlaggedOption("init-explicit", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'x', "init-explicit",
                "Initial model states are a quote-enclosed, space-separated list, given as input."),
            new FlaggedOption("max-iterations", JSAP.INTEGER_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'm', "max-iterations",
                "Maximum number of iterations to try for building the model."),
            new FlaggedOption("batch-size", JSAP.INTEGER_PARSER, Integer.toString(LearnModel.DEFAULT_BATCH_SIZE), JSAP.NOT_REQUIRED, 'b', "batch-size",
                "How many candidates to evaluate at a time before adding their children to the priority queue."),
            new FlaggedOption("search-method", JSAP.STRING_PARSER, SearchStrategy.DEFAULT_SEARCH_STRATEGY.getSimpleName(), JSAP.NOT_REQUIRED, 's',
                "search-method", "Search method, allowed values: " + LearnModel.getSearchCriteriaAsString()),
            new FlaggedOption("search-method-weight-1", JSAP.DOUBLE_PARSER, Double.toString(CloserToOrigin.DEFAULT_PROBABILITY_WEIGHT), JSAP.NOT_REQUIRED,
                'w', "search-method-weight-1", "For the method " + CloserToOrigin.class.getSimpleName()
                    + ", the relative importance of having low probability versus having less states"),
            new FlaggedOption("winner-model-maxstates", JSAP.INTEGER_PARSER, Integer.toString(LearnModel.DEFAULT_OUTPUT_MAX_STATES), JSAP.NOT_REQUIRED, 'u',
                "winner-model-maxstates",
                "Output model (winner) must have at most this number of states; this is taken only as a hint, so if there is no model with that few states, "
                    + "the one with the lower number of states will be selected"),

            new FlaggedOption("input-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'i', "input-file", "File containing the input sequences."),
            new FlaggedOption("output-assignment", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'a', "output-assignment",
                "File for writing the output cluster assignments."),
            new FlaggedOption("output-models-basename", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'o', "output-models-basename",
                "Base filename for writing the models."),

        });

    final JSAPResult jsapResult = jsap.parse(args);
View Full Code Here

    final SimpleJSAP jsap = new SimpleJSAP(
        GenerateSequences.class.getName(),
        "Generates sequences given a HMM.",
        new Parameter[] {
            new Switch("verbose", 'v', "verbose", "Set the verbose output"),
            new FlaggedOption("num-sequences", JSAP.INTEGER_PARSER, Integer.toString(DEFAULT_SEQUENCES), JSAP.NOT_REQUIRED, 'n', "num-sequences",
            "Number of sequences to generate."),
            new FlaggedOption("model-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'm', "model-file",
                "File containing the description of the HMM."),
            new FlaggedOption("taxonomy-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 't', "taxonomy-file",
                "File containing the taxonomy."),
    });
   
    final JSAPResult jsapResult = jsap.parse(args);
    if (jsap.messagePrinted())
View Full Code Here

    logger.setLevel(Level.INFO);

    final SimpleJSAP jsap = new SimpleJSAP(ComputeProbabilities.class.getName(), "Computes the probabilities of a set of sequences given a HMM.", new Parameter[] {
        new Switch("verbose", 'v', "verbose", "Set verbose output"),
        new FlaggedOption("model-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'm', "model-file", "File containing the description of the HMM."),
        new FlaggedOption("taxonomy-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 't', "taxonomy-file", "File containing the taxonomy."),
        new FlaggedOption("input-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'i', "input-file", "File containing the input sequences."),
        new FlaggedOption("sequence", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 's', "sequence",
            "Optionally, pass a single sequence as a string. Place it between quotes, with space-separated symbols.") });

    final JSAPResult jsapResult = jsap.parse(args);
    if (jsap.messagePrinted())
      return;
View Full Code Here

    final SimpleJSAP jsap = new SimpleJSAP(
        LearnModel.class.getName(),
        "Learns a HMM based on the frequency of the transitions observed. Requires a list of acceptable states where not there can not be an state and one of its descendants in the taxonomy.",
        new Parameter[] {
            new Switch("verbose", 'v', "verbose", "Set verbose output"),
            new FlaggedOption("taxonomy-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 't', "taxonomy-file",
                "File containing the description of the taxonomy."),
            new Switch("init-all-leaves", 'l', "init-all-leaves", "Initial model states are all leaves from taxonomy."),
            new FlaggedOption("init-all-level", JSAP.INTEGER_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'e', "init-all-level",
                "Initial model states are leaves or internal nodes at level <= x."),
            new FlaggedOption("init-explicit", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'x', "init-explicit",
                "Initial model states are a quote-enclosed, space-separated list, given as input."),
            new FlaggedOption("input-file", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.REQUIRED, 'i', "input-file", "File containing the input sequences."),
            new FlaggedOption("max-iterations", JSAP.INTEGER_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'm', "max-iterations",
              "Maximum number of iterations to try for building the model."),
            new FlaggedOption("batch-size", JSAP.INTEGER_PARSER, Integer.toString(DEFAULT_BATCH_SIZE), JSAP.NOT_REQUIRED, 'b', "batch-size",
              "How many candidates to evaluate at a time before adding their children to the priority queue."),
            new FlaggedOption("search-method", JSAP.STRING_PARSER, SearchStrategy.DEFAULT_SEARCH_STRATEGY.getSimpleName(), JSAP.NOT_REQUIRED, 's',
                "search-method", "Search method, allowed values: " + searchCriteria.toString()),
            new FlaggedOption("search-method-weight-1", JSAP.DOUBLE_PARSER, Double.toString(CloserToOrigin.DEFAULT_PROBABILITY_WEIGHT), JSAP.NOT_REQUIRED,
                'w', "search-method-weight-1", "For the method " + CloserToOrigin.class.getSimpleName()
                    + ", the relative importance of having low probability versus having less states"),
            new FlaggedOption("output-log", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'g', "output-log",
                "Output file for logging all searched models"),
            new FlaggedOption("output-model", JSAP.STRING_PARSER, JSAP.NO_DEFAULT, JSAP.NOT_REQUIRED, 'o', "output-model",
                "Output file for writing the winner model"),
            new FlaggedOption("winner-model-maxstates", JSAP.INTEGER_PARSER, Integer.toString(DEFAULT_OUTPUT_MAX_STATES), JSAP.NOT_REQUIRED, 'u',
                "winner-model-maxstates",
                "Output model (winner) must have at most this number of states; this is taken only as a hint, so if there is no model with that few states, "
                    + "the one with the lower number of states will be selected"),
           
        });
View Full Code Here

TOP

Related Classes of com.martiansoftware.jsap.FlaggedOption

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.