Package opennlp.tools.ml.model
Interface Prior
- All Known Implementing Classes:
UniformPrior
public interface Prior
This interface allows one to implement a prior distribution for use in
maximum entropy model training.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
logPrior
(double[] dist, int[] context) Populates the specified array with the log of the distribution for the specified context.void
logPrior
(double[] dist, int[] context, float[] values) Populates the specified array with the log of the distribution for the specified context.void
Populates the specified array with the log of the distribution for the specified context.void
Method to specify the label for the outcomes and contexts.
-
Method Details
-
logPrior
void logPrior(double[] dist, int[] context) Populates the specified array with the log of the distribution for the specified context. The returned array will be overwritten and needs to be re-initialized with every call to this method.- Parameters:
dist
- An array to be populated with the log of the prior distribution.context
- The indices of the contextual predicates for an event.
-
logPrior
void logPrior(double[] dist, int[] context, float[] values) Populates the specified array with the log of the distribution for the specified context. The returned array will be overwritten and needs to be re-initialized with every call to this method.- Parameters:
dist
- An array to be populated with the log of the prior distribution.context
- The indices of the contextual predicates for an event.values
- The values associated with the context.
-
logPrior
Populates the specified array with the log of the distribution for the specified context. The returned array will be overwritten and needs to be re-initialized with every call to this method.- Parameters:
dist
- An array to be populated with the log of the prior distribution.context
- The indices of the contextual predicates for an event.values
- The values associated with the context.
-
setLabels
Method to specify the label for the outcomes and contexts. This is used to map integer outcomes and contexts to their string values. This method is called prior to any call tologPrior(double[], int[])
.- Parameters:
outcomeLabels
- An array of each outcome label.contextLabels
- An array of each context label.
-