Class VocabConstructor.Builder<T extends SequenceElement>

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • setEntriesLimit

        public VocabConstructor.Builder<T> setEntriesLimit​(int limit)
        This method sets the limit to resulting vocabulary size. PLEASE NOTE: This method is applicable only if huffman tree is built.
        Parameters:
        limit -
        Returns:
      • useAdaGrad

        protected VocabConstructor.Builder<T> useAdaGrad​(boolean useAdaGrad)
        Defines, if adaptive gradients should be created during vocabulary mastering
        Parameters:
        useAdaGrad -
        Returns:
      • setTargetVocabCache

        public VocabConstructor.Builder<T> setTargetVocabCache​(@NonNull
                                                               @NonNull VocabCache<T> cache)
        After temporary internal vocabulary is built, it will be transferred to target VocabCache you pass here
        Parameters:
        cache - target VocabCache
        Returns:
      • addSource

        public VocabConstructor.Builder<T> addSource​(@NonNull
                                                     @NonNull SequenceIterator<T> iterator,
                                                     int minElementFrequency)
        Adds SequenceIterator for vocabulary construction. Please note, you can add as many sources, as you wish.
        Parameters:
        iterator - SequenceIterator to build vocabulary from
        minElementFrequency - elements with frequency below this value will be removed from vocabulary
        Returns:
      • fetchLabels

        public VocabConstructor.Builder<T> fetchLabels​(boolean reallyFetch)
        Sets, if labels should be fetched, during vocab building
        Parameters:
        reallyFetch -
        Returns: