Package opennlp.tools.doccat
Class BagOfWordsFeatureGenerator
java.lang.Object
opennlp.tools.doccat.BagOfWordsFeatureGenerator
- All Implemented Interfaces:
FeatureGenerator
Generates a feature for each word in a document.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionextractFeatures
(String[] text, Map<String, Object> extraInformation) Extracts features from giventext
fragments.
-
Constructor Details
-
BagOfWordsFeatureGenerator
public BagOfWordsFeatureGenerator()Instantiates a defaultBagOfWordsFeatureGenerator
instance.
-
-
Method Details
-
extractFeatures
Description copied from interface:FeatureGenerator
Extracts features from giventext
fragments.- Specified by:
extractFeatures
in interfaceFeatureGenerator
- Parameters:
text
- The text fragments to extract features fromextraInformation
- Optional extra information to be used by theFeatureGenerator
.- Returns:
- A collection of features.
-