Package de.jungblut.ner
Class BasicFeatureExtractor
- java.lang.Object
-
- de.jungblut.ner.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
-
-
Constructor Summary
Constructors Constructor Description BasicFeatureExtractor()
-
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).
-
-
-
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:SequenceFeatureExtractorCompute 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:
computeFeaturesin interfaceSequenceFeatureExtractor<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.
-
-