Package de.jungblut.ner
Class MaxEntMarkovModel
- java.lang.Object
-
- de.jungblut.classification.AbstractPredictor
-
- de.jungblut.classification.AbstractClassifier
-
- de.jungblut.ner.MaxEntMarkovModel
-
- All Implemented Interfaces:
Classifier,Predictor
public final class MaxEntMarkovModel extends AbstractClassifier
Maximum entropy markov model for named entity recognition (classifying labels in sequence learning).- Author:
- thomas.jungblut
-
-
Constructor Summary
Constructors Constructor Description MaxEntMarkovModel(de.jungblut.math.dense.DenseDoubleMatrix theta, int classes)MaxEntMarkovModel(Minimizer minimizer, int numIterations, boolean verbose)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description de.jungblut.math.DoubleMatrixgetTheta()de.jungblut.math.DoubleMatrixpredict(de.jungblut.math.DoubleMatrix features, de.jungblut.math.DoubleMatrix featuresPerState)de.jungblut.math.DoubleVectorpredict(de.jungblut.math.DoubleVector features)Classifies the given features.de.jungblut.math.DoubleVectorpredict(de.jungblut.math.DoubleVector feature, de.jungblut.math.DoubleVector[] featuresPerState)voidtrain(de.jungblut.math.DoubleVector[] features, de.jungblut.math.DoubleVector[] outcome)Trains this classifier with the given features and the outcome.-
Methods inherited from class de.jungblut.classification.AbstractClassifier
train
-
Methods inherited from class de.jungblut.classification.AbstractPredictor
extractPredictedClass, extractPredictedClass, predictedClass, predictedClass, predictProbability
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.jungblut.classification.Predictor
asClassifier, extractPredictedClass, extractPredictedClass, predictedClass, predictedClass, predictProbability
-
-
-
-
Constructor Detail
-
MaxEntMarkovModel
public MaxEntMarkovModel(Minimizer minimizer, int numIterations, boolean verbose)
-
MaxEntMarkovModel
public MaxEntMarkovModel(de.jungblut.math.dense.DenseDoubleMatrix theta, int classes)
-
-
Method Detail
-
train
public void train(de.jungblut.math.DoubleVector[] features, de.jungblut.math.DoubleVector[] outcome)Description copied from interface:ClassifierTrains this classifier with the given features and the outcome.- Specified by:
trainin interfaceClassifier- Overrides:
trainin classAbstractClassifieroutcome- the outcome must have classes labeled as doubles. E.G. in the binary case you have a single element and decide between 0d and 1d. In higher dimensional cases you have each of these single elements mapped to a dimension.
-
predict
public de.jungblut.math.DoubleVector predict(de.jungblut.math.DoubleVector features)
Description copied from interface:PredictorClassifies the given features.- Returns:
- the vector that contains an indicator at the index of the class. Usually zero or 1, in some cases it is a probability or activation value.
-
getTheta
public de.jungblut.math.DoubleMatrix getTheta()
- Returns:
- the learned parameters.
-
predict
public de.jungblut.math.DoubleVector predict(de.jungblut.math.DoubleVector feature, de.jungblut.math.DoubleVector[] featuresPerState)
-
predict
public de.jungblut.math.DoubleMatrix predict(de.jungblut.math.DoubleMatrix features, de.jungblut.math.DoubleMatrix featuresPerState)
-
-