prior.java

来自「最大熵分类器」· Java 代码 · 共 36 行

JAVA
36
字号
package opennlp.maxent;/** * This interface allows one to implement a prior distribution for use in * maximum entropy model training.   * @author Tom Morton * */public interface Prior {  /**   * Populates the specified array with the 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.     * @param dist An array to be populated with the log of the prior distribution.   * @param context The indices of the contextual predicates for an event.   */  public void logPrior(double[] dist, int[] context);    /**   * Populates the specified array with the 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.     * @param dist An array to be populated with the log of the prior distribution.   * @param context The indices of the contextual predicates for an event.   * @param values The values associated with the context.    */  public void logPrior(double[] dist, int[] context, float[] values);  /**   * 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 to #logPrior.   * @param outcomeLabels An array of each outcome label.   * @param contextLabels An array of each context label.   */  public void setLabels(String[] outcomeLabels, String[] contextLabels);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?