public static double[] PairwiseScoreThresholds(Properties props) { string thresholdsProp = props.GetProperty("coref.statistical.pairwiseScoreThresholds"); if (thresholdsProp != null) { string[] split = thresholdsProp.Split(","); if (split.Length == 4) { return(Arrays.Stream(split).MapToDouble(null).ToArray()); } } double threshold = PropertiesUtils.GetDouble(props, "coref.statistical.pairwiseScoreThresholds", 0.35); return(new double[] { threshold, threshold, threshold, threshold }); }
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); doWordEmbeddingGradUpdate = PropertiesUtils.GetBool(props, "doWordEmbeddingGradUpdate", doWordEmbeddingGradUpdate); // Runtime parsing options sentenceDelimiter = PropertiesUtils.GetString(props, "sentenceDelimiter", sentenceDelimiter); tagger = PropertiesUtils.GetString(props, "tagger.model", tagger); string escaperClass = props.GetProperty("escaper"); escaper = escaperClass != null?ReflectionLoading.LoadByReflection(escaperClass) : null; // Language options language = props.Contains("language") ? GetLanguage(props.GetProperty("language")) : language; tlp = [email protected](); // if a tlp was specified go with that string tlpCanonicalName = props.GetProperty("tlp"); if (tlpCanonicalName != null) { try { tlp = ReflectionLoading.LoadByReflection(tlpCanonicalName); System.Console.Error.WriteLine("Loaded TreebankLanguagePack: " + tlpCanonicalName); } catch (Exception) { System.Console.Error.WriteLine("Error: Failed to load TreebankLanguagePack: " + tlpCanonicalName); } } }
public static double Greedyness(Properties props) { return(PropertiesUtils.GetDouble(props, "coref.neural.greedyness", 0.5)); }
public static double GetPMIThres(Properties props, string sievename) { return(PropertiesUtils.GetDouble(props, ThresFeatureSelectionProp.Replace("SIEVENAME", sievename), 0.0001)); }
public static double GetDownsamplingRate(Properties props, string sievename) { return(PropertiesUtils.GetDouble(props, DownsampleRateProp.Replace("SIEVENAME", sievename), 1)); }
public static double GetMergeThreshold(Properties props, string sievename) { string key = ThresMergeProp.Replace("SIEVENAME", sievename); return(PropertiesUtils.GetDouble(props, key, 0.3)); }
public static double MinClassImbalance(Properties props) { return(PropertiesUtils.GetDouble(props, "coref.statistical.minClassImbalance", 0)); }