edu.isi.karma.modeling.semantictypes.crfmodelhandler
Class CRFModelHandlerOld
java.lang.Object
edu.isi.karma.modeling.semantictypes.crfmodelhandler.CRFModelHandlerOld
public class CRFModelHandlerOld
- extends java.lang.Object
Method Summary |
static boolean |
addOrUpdateLabel(java.lang.String label,
java.util.List<java.lang.String> examples,
java.util.Map<CRFModelHandlerOld.ColumnFeature,java.util.Collection<java.lang.String>> columnFeatures)
|
static boolean |
getExamplesForLabel(java.lang.String label,
java.util.ArrayList<java.lang.String> examples)
|
static boolean |
getLabels(java.util.List<java.lang.String> labels)
|
static boolean |
getWeightedFeatureFunctionSums(java.lang.String example,
java.util.Map<CRFModelHandlerOld.ColumnFeature,java.util.Collection<java.lang.String>> columnFeatures,
java.util.List<java.lang.Double> sums)
|
static boolean |
predictLabelForExamples(java.util.List<java.lang.String> examples,
int numPredictions,
java.util.List<java.lang.String> predictedLabels,
java.util.List<java.lang.Double> confidenceScores,
java.util.List<double[]> exampleProbabilities,
java.util.Map<CRFModelHandlerOld.ColumnFeature,java.util.Collection<java.lang.String>> columnFeatures)
|
static boolean |
readModelFromFile(java.lang.String file)
|
static boolean |
removeAllLabels()
|
static boolean |
removeLabel(java.lang.String label)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
addOrUpdateLabel
public static boolean addOrUpdateLabel(java.lang.String label,
java.util.List<java.lang.String> examples,
java.util.Map<CRFModelHandlerOld.ColumnFeature,java.util.Collection<java.lang.String>> columnFeatures)
- Parameters:
label
- True labelexamples
- list of examplescolumnFeatures
- List of column features
- Returns:
- True if success, else False
getExamplesForLabel
public static boolean getExamplesForLabel(java.lang.String label,
java.util.ArrayList<java.lang.String> examples)
- Parameters:
label
- - the label for which examples are being requestedexamples
- - the list argument that will contain all the examples of the supplied label in the model.
- Returns:
getLabels
public static boolean getLabels(java.util.List<java.lang.String> labels)
- Parameters:
labels,
- the ordered list of labels is returned in this argument
- Returns:
getWeightedFeatureFunctionSums
public static boolean getWeightedFeatureFunctionSums(java.lang.String example,
java.util.Map<CRFModelHandlerOld.ColumnFeature,java.util.Collection<java.lang.String>> columnFeatures,
java.util.List<java.lang.Double> sums)
predictLabelForExamples
public static boolean predictLabelForExamples(java.util.List<java.lang.String> examples,
int numPredictions,
java.util.List<java.lang.String> predictedLabels,
java.util.List<java.lang.Double> confidenceScores,
java.util.List<double[]> exampleProbabilities,
java.util.Map<CRFModelHandlerOld.ColumnFeature,java.util.Collection<java.lang.String>> columnFeatures)
- Parameters:
examples
- - list of examples of an unknown typenumPredictions
- - required number of predictions in descending orderpredictedLabels
- - the argument in which the ordered list of labels is returned. the size of this list could be smaller than numPredictions
if there aren't that many labels in the model alreadyconfidenceScores
- - the probability of the examples belonging to the labels returned.exampleProbabilities
- - the size() == examples.size(). It contains, for each example, in the same order, a double array that contains the probability
of belonging to the labels returned in predictedLabels.columnFeatures
- - this Map supplies ColumnFeatures such as ColumnName, etc.
- Returns:
readModelFromFile
public static boolean readModelFromFile(java.lang.String file)
removeAllLabels
public static boolean removeAllLabels()
removeLabel
public static boolean removeLabel(java.lang.String label)