mark.nlp.features
Class ClassificationOrderer
java.lang.Object
|
+--mark.nlp.features.ClassificationOrderer
- All Implemented Interfaces:
- Orderer
- Direct Known Subclasses:
- SimpleOrderer, TwoLevelOrderer
- public abstract class ClassificationOrderer
- extends java.lang.Object
- implements Orderer
An Orderer that orders according to usefullness during classification.
After ordering, potential features with lower indices are more useful.
|
Method Summary |
protected abstract java.util.ArrayList |
computeScores()
Subclasses implement the following function which returns a Score
for each potential feature in the set of potential features. |
ObjectMap |
order(BagCorpusCounter counter,
BagCorpusCounter[] catCounters,
ObjectMap potentialFeatures,
java.lang.String parameter)
Given corpus counters for a data set and a set of potential features,
orders the potential features according to how useful they will be during
classification. |
protected void |
setParameter(java.lang.String parameter)
Subclasses override the following function if they use the parameter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fCounter
protected BagCorpusCounter fCounter
fCatCounters
protected BagCorpusCounter[] fCatCounters
fPotentialFeatures
protected ObjectMap fPotentialFeatures
ClassificationOrderer
public ClassificationOrderer()
setParameter
protected void setParameter(java.lang.String parameter)
- Subclasses override the following function if they use the parameter.
- Parameters:
parameter - the parameter.
computeScores
protected abstract java.util.ArrayList computeScores()
throws java.lang.Exception
- Subclasses implement the following function which returns a Score
for each potential feature in the set of potential features.
- Returns:
- an array list of Scores. The array list is parallel to
fVocabulary.
java.lang.Exception
order
public ObjectMap order(BagCorpusCounter counter,
BagCorpusCounter[] catCounters,
ObjectMap potentialFeatures,
java.lang.String parameter)
throws java.lang.Exception
- Given corpus counters for a data set and a set of potential features,
orders the potential features according to how useful they will be during
classification.
- Specified by:
order in interface Orderer
- Parameters:
counter - a corpus counter in which each bag corresponds to a category.catCounters - a set of counters. For the counter with index i, bags
correspond to documents within category i.potentialFeatures - the set of potential features.
- Returns:
- the same set of potential features ordered according to the
estimated usefullness during classification. Lower indices correspond to
more useful features.
java.lang.Exception