Class AddClassifierTokenPredictions

  • All Implemented Interfaces:

    public class AddClassifierTokenPredictions
    extends Pipe
    This pipe uses a Classifier to label each token (i.e., using 0-th order Markov assumption), then adds the predictions as features to each token. This pipe assumes the input Instance's data is of type FeatureVectorSequence (each an augmentable feature vector). Example usage:
                    1) Create and serialize a featurePipe that converts raw input to FeatureVectorSequences
                    2) Pipe input data through featurePipe, train a TokenClassifiers via cross validation, then serialize the classifiers
                    2) Pipe input data through featurePipe and this pipe (using the saved classifiers), and train a Transducer 
                    4) Serialize the trained Transducer 
    See Also:
    Serialized Form
    • Method Detail

      • setInProduction

        public void setInProduction​(boolean inProduction)
      • getInProduction

        public boolean getInProduction()
      • setInProduction

        public static void setInProduction​(Pipe p,
                                           boolean value)
      • pipe

        public Instance pipe​(Instance carrier)
        Add the token classifier's predictions as features to the instance. This method assumes the input instance contains FeatureVectorSequence as data
        pipe in class Pipe
      • convert

        public static InstanceList convert​(InstanceList ilist,
                                           Noop alphabetsPipe)
        Converts each instance containing a FeatureVectorSequence to multiple instances, each containing an AugmentableFeatureVector as data.
        ilist - Instances with FeatureVectorSequence as data field
        alphabetsPipe - a Noop pipe containing the data and target alphabets for the resulting InstanceList
        an InstanceList where each Instance contains one Token's AugmentableFeatureVector as data
      • convert

        public static InstanceList convert​(Instance inst,
                                           Noop alphabetsPipe)
        inst - input instance, with FeatureVectorSequence as data.
        alphabetsPipe - a Noop pipe containing the data and target alphabets for the resulting InstanceList and AugmentableFeatureVectors
        list of instances, each with one AugmentableFeatureVector as data