sg.edu.nus.comp.nlp.ims.classifier
Class CPreLoadWekaEvaluator

java.lang.Object
  extended by sg.edu.nus.comp.nlp.ims.classifier.CWekaEvaluator
      extended by sg.edu.nus.comp.nlp.ims.classifier.CPreLoadWekaEvaluator
All Implemented Interfaces:
IEvaluator

public class CPreLoadWekaEvaluator
extends CWekaEvaluator

Evaluator which pre-load some models.

Author:
zhongzhi

Nested Class Summary
 
Nested classes/interfaces inherited from class sg.edu.nus.comp.nlp.ims.classifier.CWekaEvaluator
CWekaEvaluator.ResultInfo
 
Field Summary
protected  int m_Capacity
           
protected  weka.classifiers.Classifier[] m_Classifiers
           
protected  java.util.ArrayList<java.lang.Integer> m_Loaded
           
protected  java.util.Hashtable<java.lang.String,java.lang.Integer> m_ReverseIndice
           
protected  java.util.HashSet<java.lang.String> m_StaticOnes
           
protected  IStatistic[] m_Statistics
           
 
Fields inherited from class sg.edu.nus.comp.nlp.ims.classifier.CWekaEvaluator
LEXELTPATTERN, m_ClassIndex, m_ModelDir, m_SenseIndex, m_StatDir, m_UnknownSense
 
Constructor Summary
CPreLoadWekaEvaluator()
           
 
Method Summary
protected  void checkCapacity(java.lang.Integer p_Lexelt)
          check the capacity
protected  weka.classifiers.Classifier getModel(java.lang.String p_LexeltID)
          get weka model
protected  IStatistic getStatistic(java.lang.String p_LexeltID)
          get statistic for lexelt
protected  void initial()
          initial the evaluator
 void setOptions(java.lang.String[] p_Options)
          set options
 
Methods inherited from class sg.edu.nus.comp.nlp.ims.classifier.CWekaEvaluator
evaluate, setSenseIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Capacity

protected int m_Capacity

m_Classifiers

protected weka.classifiers.Classifier[] m_Classifiers

m_Statistics

protected IStatistic[] m_Statistics

m_StaticOnes

protected java.util.HashSet<java.lang.String> m_StaticOnes

m_ReverseIndice

protected java.util.Hashtable<java.lang.String,java.lang.Integer> m_ReverseIndice

m_Loaded

protected java.util.ArrayList<java.lang.Integer> m_Loaded
Constructor Detail

CPreLoadWekaEvaluator

public CPreLoadWekaEvaluator()
Method Detail

checkCapacity

protected void checkCapacity(java.lang.Integer p_Lexelt)
check the capacity

Parameters:
p_Lexelt - lexelt id

getModel

protected weka.classifiers.Classifier getModel(java.lang.String p_LexeltID)
                                        throws java.io.IOException,
                                               java.lang.ClassNotFoundException
Description copied from class: CWekaEvaluator
get weka model

Overrides:
getModel in class CWekaEvaluator
Parameters:
p_LexeltID - lexelt id
Returns:
weka classifier
Throws:
java.io.IOException - io exception
java.lang.ClassNotFoundException - class not found

getStatistic

protected IStatistic getStatistic(java.lang.String p_LexeltID)
Description copied from class: CWekaEvaluator
get statistic for lexelt

Overrides:
getStatistic in class CWekaEvaluator
Parameters:
p_LexeltID - lexelt id
Returns:
statistic

setOptions

public void setOptions(java.lang.String[] p_Options)
Description copied from interface: IEvaluator
set options

Specified by:
setOptions in interface IEvaluator
Overrides:
setOptions in class CWekaEvaluator
Parameters:
p_Options - options

initial

protected void initial()
                throws java.io.IOException,
                       java.lang.ClassNotFoundException
initial the evaluator

Throws:
java.io.IOException - exception while loading model or statistic
java.lang.ClassNotFoundException - model cannot be converted to classifier