Example usage for edu.stanford.nlp.util PropertiesUtils getInt

List of usage examples for edu.stanford.nlp.util PropertiesUtils getInt

Introduction

In this page you can find the example usage for edu.stanford.nlp.util PropertiesUtils getInt.

Prototype

public static int getInt(Properties props, String key, int defaultValue) 

Source Link

Document

Load an integer property.

Usage

From source file:ilcc.ccgparser.incderivation.IncParser.java

protected void init(Properties props) throws IOException {
    model = new AvePerceptron();
    sSize = 0;/*from   www  . j a  v a 2 s . com*/
    goldDetails = new HashMap<>();
    trainAutoFile = props.getProperty("trainAuto");
    trainCoNLLFile = props.getProperty("trainCoNLL");
    trainPargFile = props.getProperty("trainParg");
    testAutoFile = props.getProperty("testAuto");
    testPargFile = props.getProperty("testParg");
    testCoNLLFile = props.getProperty("testCoNLL");
    outAutoFile = props.getProperty("outAuto");
    outPargFile = props.getProperty("outParg");
    modelFile = props.getProperty("model");

    incalgo = props.getProperty("algo").equals("RevInc");
    isTrain = PropertiesUtils.getBool(props, "isTrain", false);
    beamSize = PropertiesUtils.getInt(props, "beam", 1);
    iters = PropertiesUtils.getInt(props, "iters", 10);
    early_update = PropertiesUtils.getBool(props, "early", false);
    lookAhead = PropertiesUtils.getBool(props, "lookAhead", true);
    debug = PropertiesUtils.getInt(props, "debug", 0);

    srparser = (incalgo) ? new RevInc() : new NonInc();
    srparser.incalgo = incalgo;
    Commons.setDebug(debug);
    Commons.setIncAlgo(incalgo);
    actsMap = new HashMap<>();
}

From source file:ilcc.ccgparser.nnparser.Config.java

private void setProperties(Properties props) {
    trainingThreads = PropertiesUtils.getInt(props, "trainingThreads", trainingThreads);
    wordCutOff = PropertiesUtils.getInt(props, "wordCutOff", wordCutOff);
    initRange = PropertiesUtils.getDouble(props, "initRange", initRange);
    maxIter = PropertiesUtils.getInt(props, "maxIter", maxIter);
    batchSize = PropertiesUtils.getInt(props, "batchSize", batchSize);
    adaEps = PropertiesUtils.getDouble(props, "adaEps", adaEps);
    adaAlpha = PropertiesUtils.getDouble(props, "adaAlpha", adaAlpha);
    regParameter = PropertiesUtils.getDouble(props, "regParameter", regParameter);
    dropProb = PropertiesUtils.getDouble(props, "dropProb", dropProb);
    hiddenSize = PropertiesUtils.getInt(props, "hiddenSize", hiddenSize);
    embeddingSize = PropertiesUtils.getInt(props, "embeddingSize", embeddingSize);
    numPreComputed = PropertiesUtils.getInt(props, "numPreComputed", numPreComputed);
    evalPerIter = PropertiesUtils.getInt(props, "evalPerIter", evalPerIter);
    clearGradientsPerIter = PropertiesUtils.getInt(props, "clearGradientsPerIter", clearGradientsPerIter);
    saveIntermediate = PropertiesUtils.getBool(props, "saveIntermediate", saveIntermediate);
    unlabeled = PropertiesUtils.getBool(props, "unlabeled", unlabeled);
    cPOS = PropertiesUtils.getBool(props, "cPOS", cPOS);
    noPunc = PropertiesUtils.getBool(props, "noPunc", noPunc);
    lookAhead = PropertiesUtils.getBool(props, "lookAhead", false);
    numTokens = (lookAhead) ? 39 : 33;/*ww  w .j  a v  a 2s  .com*/
}