Codota Logo
MutableContext.getParameters
Code IndexAdd Codota to your IDE (free)

How to use
getParameters
method
in
opennlp.model.MutableContext

Best Java code snippets using opennlp.model.MutableContext.getParameters (Showing top 12 results out of 315)

  • Common ways to obtain MutableContext
private void myMethod () {
MutableContext m =
  • Codota Iconnew MutableContext(outcomePattern, new double[numActiveOutcomes])
  • Smart code suggestions by Codota
}
origin: org.apache.opennlp/opennlp-maxent

private double gaussianUpdate(int predicate, int oid, int n, double correctionConstant) {
 double param = params[predicate].getParameters()[oid];
 double x0 = 0.0;
 double modelValue = modelExpects[0][predicate].getParameters()[oid];
 double observedValue = observedExpects[predicate].getParameters()[oid];
 for (int i = 0; i < 50; i++) {
  double tmp = modelValue * Math.exp(correctionConstant * x0);
  double f = tmp + (param + x0) / sigma - observedValue;
  double fp = tmp * correctionConstant + 1 / sigma;
  if (fp == 0) {
   break;
  }
  double x = x0 - f / fp;
  if (Math.abs(x - x0) < 0.000001) {
   x0 = x;
   break;
  }
  x0 = x;
 }
 return x0;
}

origin: org.maochen.nlp/CoreNLP-NLP

private double gaussianUpdate(int predicate, int oid, double correctionConstant) {
  double param = params[predicate].getParameters()[oid];
  double x0 = 0.0;
  double modelValue = modelExpects[0][predicate].getParameters()[oid];
  double observedValue = observedExpects[predicate].getParameters()[oid];
  for (int i = 0; i < 50; i++) {
    double tmp = modelValue * Math.exp(correctionConstant * x0);
    double f = tmp + (param + x0) / sigma - observedValue;
    double fp = tmp * correctionConstant + 1 / sigma;
    if (fp == 0) {
      break;
    }
    double x = x0 - f / fp;
    if (Math.abs(x - x0) < 0.000001) {
      x0 = x;
      break;
    }
    x0 = x;
  }
  return x0;
}
origin: joliciel-informatique/talismane

private double gaussianUpdate(int predicate, int oid, int n, double correctionConstant) {
 double param = params[predicate].getParameters()[oid];
 double x0 = 0.0;
 double modelValue = modelExpects[0][predicate].getParameters()[oid];
 double observedValue = observedExpects[predicate].getParameters()[oid];
 for (int i = 0; i < 50; i++) {
  double tmp = modelValue * Math.exp(correctionConstant * x0);
  double f = tmp + (param + x0) / sigma - observedValue;
  double fp = tmp * correctionConstant + 1 / sigma;
  if (fp == 0) {
   break;
  }
  double x = x0 - f / fp;
  if (Math.abs(x - x0) < 0.000001) {
   x0 = x;
   break;
  }
  x0 = x;
 }
 return x0;
}
origin: Ailab403/ailab-mltk4j

private double gaussianUpdate(int predicate, int oid, int n, double correctionConstant) {
 double param = params[predicate].getParameters()[oid];
 double x0 = 0.0;
 double modelValue = modelExpects[0][predicate].getParameters()[oid];
 double observedValue = observedExpects[predicate].getParameters()[oid];
 for (int i = 0; i < 50; i++) {
  double tmp = modelValue * Math.exp(correctionConstant * x0);
  double f = tmp + (param + x0) / sigma - observedValue;
  double fp = tmp * correctionConstant + 1 / sigma;
  if (fp == 0) {
   break;
  }
  double x = x0 - f / fp;
  if (Math.abs(x - x0) < 0.000001) {
   x0 = x;
   break;
  }
  x0 = x;
 }
 return x0;
}

origin: org.maochen.nlp/CoreNLP-NLP

    modelExpects[0][pi].updateParameter(aoi, modelExpects[i][pi].getParameters()[aoi]);
double[] observed = observedExpects[pi].getParameters();
double[] model = modelExpects[0][pi].getParameters();
int[] activeOutcomes = params[pi].getOutcomes();
for (int aoi = 0; aoi < activeOutcomes.length; aoi++) {
origin: Ailab403/ailab-mltk4j

  modelExpects[0][pi].updateParameter(aoi, modelExpects[i][pi].getParameters()[aoi]);
double[] observed = observedExpects[pi].getParameters();
double[] model = modelExpects[0][pi].getParameters();
int[] activeOutcomes = params[pi].getOutcomes();
for (int aoi=0;aoi<activeOutcomes.length;aoi++) {
origin: org.apache.opennlp/opennlp-maxent

  modelExpects[0][pi].updateParameter(aoi, modelExpects[i][pi].getParameters()[aoi]);
double[] observed = observedExpects[pi].getParameters();
double[] model = modelExpects[0][pi].getParameters();
int[] activeOutcomes = params[pi].getOutcomes();
for (int aoi=0;aoi<activeOutcomes.length;aoi++) {
origin: joliciel-informatique/talismane

  modelExpects[0][pi].updateParameter(aoi, modelExpects[i][pi].getParameters()[aoi]);
double[] observed = observedExpects[pi].getParameters();
double[] model = modelExpects[0][pi].getParameters();
int[] activeOutcomes = params[pi].getOutcomes();
for (int aoi = 0; aoi < activeOutcomes.length; aoi++) {
origin: org.apache.opennlp/opennlp-maxent

      updates[pi][oi][VALUE] = (int) params[pi].getParameters()[oi];
      updates[pi][oi][ITER] = iteration;
      updates[pi][oi][EVENT] = si;
if (useAverage && iteration == iterations-1) {
 for (int pi = 0; pi < numPreds; pi++) {
  double[] predParams = averageParams[pi].getParameters();
  for (int oi = 0;oi<numOutcomes;oi++) {
   if (updates[pi][oi][VALUE] != 0) {
origin: Ailab403/ailab-mltk4j

      updates[pi][oi][VALUE] = (int) params[pi].getParameters()[oi];
      updates[pi][oi][ITER] = iteration;
      updates[pi][oi][EVENT] = si;
if (useAverage && iteration == iterations-1) {
 for (int pi = 0; pi < numPreds; pi++) {
  double[] predParams = averageParams[pi].getParameters();
  for (int oi = 0;oi<numOutcomes;oi++) {
   if (updates[pi][oi][VALUE] != 0) {
origin: org.apache.opennlp/opennlp-maxent

 for (int pi = 0; pi < numPreds; pi++) 
  for (int aoi=0;aoi<numOutcomes;aoi++)
   summedParams[pi].updateParameter(aoi, params[pi].getParameters()[aoi]);
for (int pi = 0; pi < numPreds; pi++) 
 for (int aoi=0;aoi<numOutcomes;aoi++)
  summedParams[pi].setParameter(aoi, summedParams[pi].getParameters()[aoi]/numTimesSummed);
origin: Ailab403/ailab-mltk4j

 for (int pi = 0; pi < numPreds; pi++) 
  for (int aoi=0;aoi<numOutcomes;aoi++)
   summedParams[pi].updateParameter(aoi, params[pi].getParameters()[aoi]);
for (int pi = 0; pi < numPreds; pi++) 
 for (int aoi=0;aoi<numOutcomes;aoi++)
  summedParams[pi].setParameter(aoi, summedParams[pi].getParameters()[aoi]/numTimesSummed);
opennlp.modelMutableContextgetParameters

Popular methods of MutableContext

  • <init>
    Creates a new parameters object with the specified parameters associated with the specified outcome
  • getOutcomes
  • setParameter
    Assigns the parameter or expected value at the specified outcomeIndex the specified value.
  • updateParameter
    Updated the parameter or expected value at the specified outcomeIndex by adding the specified value

Popular in Java

  • Creating JSON documents from java classes using gson
  • onRequestPermissionsResult (Fragment)
  • getSharedPreferences (Context)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Runner (org.openjdk.jmh.runner)
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