public static class VocabConstructor.Builder<T extends SequenceElement>
extends java.lang.Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
VocabConstructor.Builder<T> |
addSource(SequenceIterator<T> iterator,
int minElementFrequency)
Adds SequenceIterator for vocabulary construction.
|
VocabConstructor.Builder<T> |
allowParallelTokenization(boolean reallyAllow) |
VocabConstructor<T> |
build() |
VocabConstructor.Builder<T> |
enableScavenger(boolean reallyEnable) |
VocabConstructor.Builder<T> |
fetchLabels(boolean reallyFetch)
Sets, if labels should be fetched, during vocab building
|
VocabConstructor.Builder<T> |
setEntriesLimit(int limit)
This method sets the limit to resulting vocabulary size.
|
VocabConstructor.Builder<T> |
setIndex(InvertedIndex<T> index) |
VocabConstructor.Builder<T> |
setStopWords(java.util.Collection<java.lang.String> stopWords) |
VocabConstructor.Builder<T> |
setTargetVocabCache(VocabCache<T> cache)
After temporary internal vocabulary is built, it will be transferred to target VocabCache you pass here
|
VocabConstructor.Builder<T> |
setUnk(T unk) |
protected VocabConstructor.Builder<T> |
useAdaGrad(boolean useAdaGrad)
Defines, if adaptive gradients should be created during vocabulary mastering
|
public VocabConstructor.Builder<T> setEntriesLimit(int limit)
limit
- public VocabConstructor.Builder<T> allowParallelTokenization(boolean reallyAllow)
protected VocabConstructor.Builder<T> useAdaGrad(boolean useAdaGrad)
useAdaGrad
- public VocabConstructor.Builder<T> setTargetVocabCache(@NonNull VocabCache<T> cache)
cache
- target VocabCachepublic VocabConstructor.Builder<T> addSource(@NonNull SequenceIterator<T> iterator, int minElementFrequency)
iterator
- SequenceIterator to build vocabulary fromminElementFrequency
- elements with frequency below this value will be removed from vocabularypublic VocabConstructor.Builder<T> setStopWords(@NonNull java.util.Collection<java.lang.String> stopWords)
public VocabConstructor.Builder<T> fetchLabels(boolean reallyFetch)
reallyFetch
- public VocabConstructor.Builder<T> setIndex(InvertedIndex<T> index)
public VocabConstructor.Builder<T> enableScavenger(boolean reallyEnable)
public VocabConstructor.Builder<T> setUnk(T unk)
public VocabConstructor<T> build()