opennlp.perceptron
Class PerceptronModel
java.lang.Object
opennlp.model.AbstractModel
opennlp.perceptron.PerceptronModel
- All Implemented Interfaces:
- MaxentModel
public class PerceptronModel
- extends AbstractModel
Constructor Summary |
PerceptronModel(Context[] params,
java.lang.String[] predLabels,
java.util.Map<java.lang.String,java.lang.Integer> pmap,
java.lang.String[] outcomeNames)
|
PerceptronModel(Context[] params,
java.lang.String[] predLabels,
java.lang.String[] outcomeNames)
|
Method Summary |
static double[] |
eval(int[] context,
double[] prior,
EvalParameters model)
|
static double[] |
eval(int[] context,
float[] values,
double[] prior,
EvalParameters model,
boolean normalize)
|
double[] |
eval(java.lang.String[] context)
Evaluates a context. |
double[] |
eval(java.lang.String[] context,
double[] probs)
Evaluates a context. |
double[] |
eval(java.lang.String[] context,
float[] values)
Evaluates a contexts with the specified context values. |
double[] |
eval(java.lang.String[] context,
float[] values,
double[] outsums)
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PerceptronModel
public PerceptronModel(Context[] params,
java.lang.String[] predLabels,
java.util.Map<java.lang.String,java.lang.Integer> pmap,
java.lang.String[] outcomeNames)
PerceptronModel
public PerceptronModel(Context[] params,
java.lang.String[] predLabels,
java.lang.String[] outcomeNames)
eval
public double[] eval(java.lang.String[] context)
- Description copied from interface:
MaxentModel
- Evaluates a context.
- Parameters:
context
- A list of String names of the contextual predicates
which are to be evaluated together.
- Returns:
- an array of the probabilities for each of the different
outcomes, all of which sum to 1.
eval
public double[] eval(java.lang.String[] context,
float[] values)
- Description copied from interface:
MaxentModel
- Evaluates a contexts with the specified context values.
- Parameters:
context
- A list of String names of the contextual predicates
which are to be evaluated together.values
- The values associated with each context.
- Returns:
- an array of the probabilities for each of the different outcomes, all of which sum to 1.
eval
public double[] eval(java.lang.String[] context,
double[] probs)
- Description copied from interface:
MaxentModel
- Evaluates a context.
- Parameters:
context
- A list of String names of the contextual predicates
which are to be evaluated together.probs
- An array which is populated with the probabilities for each of the different
outcomes, all of which sum to 1.
- Returns:
- an array of the probabilities for each of the different outcomes, all of which sum to 1.
eval
public double[] eval(java.lang.String[] context,
float[] values,
double[] outsums)
eval
public static double[] eval(int[] context,
double[] prior,
EvalParameters model)
eval
public static double[] eval(int[] context,
float[] values,
double[] prior,
EvalParameters model,
boolean normalize)
main
public static void main(java.lang.String[] args)
throws java.io.IOException
- Throws:
java.io.IOException
Copyright © 2011 The Apache Software Foundation. All Rights Reserved.