Package opennlp.tools.ml.model
Schnittstelle MaxentModel
- Alle bekannten Implementierungsklassen:
AbstractModel,GISModel,NaiveBayesModel,PerceptronModel,QNModel
public interface MaxentModel
Interface for maximum entropy models.
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungdouble[]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.
-
Methodendetails
-
eval
Evaluates acontext.- Parameter:
context- An array of String names of the contextual predicates which are to be evaluated together.- Gibt zurück:
- An array of the probabilities for each of the different
outcomes, all of which sum to
1.
-
eval
Evaluates acontext.- Parameter:
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.- Gibt zurück:
- An array of the probabilities for each of the different
outcomes, all of which sum to
1.
-
eval
Evaluates acontextwith the specified contextvalues.- Parameter:
context- An array of String names of the contextual predicates which are to be evaluated together.values- The values associated with each context.- Gibt zurück:
- An array of the probabilities for each of the different
outcomes, all of which sum to
1.
-
getBestOutcome
Retrieves the outcome associated with the index containing the highest probability in the double[].- Parameter:
outcomes- Adouble[]as returned by theeval(String[])method.- Gibt zurück:
- The String name of the best outcome.
-
getAllOutcomes
Retrieves a string matching all the outcome names with all the probabilities produced by theeval(String[])method.- Parameter:
outcomes- Adouble[]as returned by theeval(String[])method.- Gibt zurück:
- String containing outcome names paired with the normalized
probability (contained in the
double[] ocs) for each one.
-
getOutcome
Retrieves the String name of the outcome associated with the indexi.- Parameter:
i- The index for which the name of the associated outcome is desired.- Gibt zurück:
- The String name of the outcome
-
getIndex
Retrieves the index associated with the String name of the given outcome.- Parameter:
outcome- The String name of the outcome for which the index is desired,- Gibt zurück:
- The index if the given outcome label exists for this
model,
-1if it does not.
-
getNumOutcomes
int getNumOutcomes()- Gibt zurück:
- Retrieves the number of outcomes for this model.
-