Class BasicFeatureExtractor

  • All Implemented Interfaces:
    SequenceFeatureExtractor<java.lang.String>

    public final class BasicFeatureExtractor
    extends java.lang.Object
    implements SequenceFeatureExtractor<java.lang.String>
    Basic feature extraction for sequence learning, takes the current word into account and the previous label - as well as the joint version of both. This will implicitly create a dictionary in your features.
    This was used to derive names from an english text.
    Author:
    thomas.jungblut
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> computeFeatures​(java.util.List<java.lang.String> words, int previousLabel, int position)
      Compute a feature for the given sequence (the complete list words).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BasicFeatureExtractor

        public BasicFeatureExtractor()
    • Method Detail

      • computeFeatures

        public java.util.List<java.lang.String> computeFeatures​(java.util.List<java.lang.String> words,
                                                                int previousLabel,
                                                                int position)
        Description copied from interface: SequenceFeatureExtractor
        Compute a feature for the given sequence (the complete list words). Given are the previous label and the current index (position). This method will be called for every index in the list of words.
        Specified by:
        computeFeatures in interface SequenceFeatureExtractor<java.lang.String>
        Parameters:
        words - all words in that sequence.
        previousLabel - the previous label.
        position - the current position.
        Returns:
        a set of features for this position.