Package opennlp.tools.ml.model
Interface MaxentModel
- All Known Implementing Classes:
- AbstractModel,- GISModel,- NaiveBayesModel,- PerceptronModel,- QNModel
public interface MaxentModel
Interface for maximum entropy models.
- 
Method SummaryModifier and TypeMethodDescriptiondouble[]Evaluates acontext.double[]Evaluates acontext.double[]Evaluates acontextwith the specified contextvalues.getAllOutcomes(double[] outcomes) Retrieves a string matching all the outcome names with all the probabilities produced by theeval(String[])method.getBestOutcome(double[] outcomes) Retrieves the outcome associated with the index containing the highest probability in the double[].intRetrieves the index associated with the String name of the given outcome.intgetOutcome(int i) Retrieves the String name of the outcome associated with the indexi.
- 
Method Details- 
evalEvaluates acontext.- Parameters:
- context- An array 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.
 
- 
evalEvaluates acontext.- Parameters:
- context- An array 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.
 
- 
evalEvaluates acontextwith the specified contextvalues.- Parameters:
- context- An array 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.
 
- 
getBestOutcomeRetrieves the outcome associated with the index containing the highest probability in the double[].- Parameters:
- outcomes- A- double[]as returned by the- eval(String[])method.
- Returns:
- The String name of the best outcome.
 
- 
getAllOutcomesRetrieves a string matching all the outcome names with all the probabilities produced by theeval(String[])method.- Parameters:
- outcomes- A- double[]as returned by the- eval(String[])method.
- Returns:
- String containing outcome names paired with the normalized
         probability (contained in the double[] ocs) for each one.
 
- 
getOutcomeRetrieves the String name of the outcome associated with the indexi.- Parameters:
- i- The index for which the name of the associated outcome is desired.
- Returns:
- The String name of the outcome
 
- 
getIndexRetrieves the index associated with the String name of the given outcome.- Parameters:
- outcome- The String name of the outcome for which the index is desired,
- Returns:
- The index if the given outcome label exists for this
         model, -1if it does not.
 
- 
getNumOutcomesint getNumOutcomes()- Returns:
- Retrieves the number of outcomes for this model.
 
 
-