public abstract class TextVectorizer<VECTOR_TYPE> extends Object implements Vectorizer<VECTOR_TYPE>
Vectorizer.RecordCallBack| Modifier and Type | Field and Description |
|---|---|
protected VocabCache |
cache |
static String |
MIN_WORD_FREQUENCY |
protected int |
minWordFrequency |
static String |
STOP_WORDS |
protected Collection<String> |
stopWords |
static String |
TOKENIZER |
protected TokenizerFactory |
tokenizerFactory |
| Constructor and Description |
|---|
TextVectorizer() |
| Modifier and Type | Method and Description |
|---|---|
abstract TokenizerFactory |
createTokenizerFactory(Configuration conf)
Create tokenizer factory based on the configuration
|
abstract void |
doWithTokens(Tokenizer tokenizer)
Increment counts, add to collection,...
|
void |
fit(RecordReader reader) |
void |
fit(RecordReader reader,
Vectorizer.RecordCallBack callBack) |
void |
initialize(Configuration conf) |
protected String |
toString(Collection<Writable> record) |
protected Counter<String> |
wordFrequenciesForRecord(Collection<Writable> record) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateVector, fitTransform, fitTransform, transformprotected TokenizerFactory tokenizerFactory
protected int minWordFrequency
public static final String MIN_WORD_FREQUENCY
public static final String STOP_WORDS
public static final String TOKENIZER
protected Collection<String> stopWords
protected VocabCache cache
public void initialize(Configuration conf)
initialize in interface Vectorizer<VECTOR_TYPE>public void fit(RecordReader reader)
fit in interface Vectorizer<VECTOR_TYPE>public void fit(RecordReader reader, Vectorizer.RecordCallBack callBack)
fit in interface Vectorizer<VECTOR_TYPE>protected Counter<String> wordFrequenciesForRecord(Collection<Writable> record)
protected String toString(Collection<Writable> record)
public abstract void doWithTokens(Tokenizer tokenizer)
tokenizer - public abstract TokenizerFactory createTokenizerFactory(Configuration conf)
conf - the configuration to useCopyright © 2015. All rights reserved.