Package opennlp.tools.ml.maxent
Class GISModel
java.lang.Object
opennlp.tools.ml.model.AbstractModel
opennlp.tools.ml.maxent.GISModel
- All Implemented Interfaces:
MaxentModel
A maximum entropy model which has been trained using the Generalized
Iterative Scaling procedure (implemented in GIS.java).
-
Nested Class Summary
Nested classes/interfaces inherited from class opennlp.tools.ml.model.AbstractModel
AbstractModel.ModelType -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new model with the specified parameters, outcome names, and predicate/feature labels.Creates a new model with the specified parameters, outcome names, and predicate/feature labels. -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]eval(int[] context, double[] prior, EvalParameters model) Use this model to evaluate a context and return an array of the likelihood of each outcome given the specified context and the specified parameters.final double[]Use this model to evaluate a context and return an array of the likelihood of each outcome given that context.final double[]Evaluates a context.final double[]Evaluates a contexts with the specified context values.final double[]Use this model to evaluate a context and return an array of the likelihood of each outcome given that context.Methods inherited from class opennlp.tools.ml.model.AbstractModel
equals, getAllOutcomes, getBestOutcome, getDataStructures, getIndex, getModelType, getNumOutcomes, getOutcome, hashCode
-
Constructor Details
-
GISModel
Creates a new model with the specified parameters, outcome names, and predicate/feature labels.- Parameters:
params- The parameters of the model.predLabels- The names of the predicates used in this model.outcomeNames- The names of the outcomes this model predicts.
-
GISModel
Creates a new model with the specified parameters, outcome names, and predicate/feature labels.- Parameters:
params- The parameters of the model.predLabels- The names of the predicates used in this model.outcomeNames- The names of the outcomes this model predicts.prior- The prior to be used with this model.
-
-
Method Details
-
eval
Use this model to evaluate a context and return an array of the likelihood of each outcome given that context.- Parameters:
context- The names of the predicates which have been observed at the present decision point.- Returns:
- The normalized probabilities for the outcomes given the context. The indexes of the double[] are the outcome ids, and the actual string representation of the outcomes can be obtained from the method getOutcome(int i).
-
eval
Description copied from interface:MaxentModelEvaluates 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
Description copied from interface:MaxentModelEvaluates a context.- Parameters:
context- A list of String names of the contextual predicates which are to be evaluated together.outsums- 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
Use this model to evaluate a context and return an array of the likelihood of each outcome given that context.- Parameters:
context- The names of the predicates which have been observed at the present decision point.outsums- This is where the distribution is stored.- Returns:
- The normalized probabilities for the outcomes given the context. The indexes of the double[] are the outcome ids, and the actual string representation of the outcomes can be obtained from the method getOutcome(int i).
-
eval
Use this model to evaluate a context and return an array of the likelihood of each outcome given the specified context and the specified parameters.- Parameters:
context- The integer values of the predicates which have been observed at the present decision point.prior- The prior distribution for the specified context.model- The set of parametes used in this computation.- Returns:
- The normalized probabilities for the outcomes given the context. The indexes of the double[] are the outcome ids, and the actual string representation of the outcomes can be obtained from the method getOutcome(int i).
-