(src_sents, tgt_sents, vocab_size, freq_cutoff)
return Vocab(src, tgt)
Build Vocabulary.
        @param src_sents (list[str]): Source sentences provided by read_corpus() function
        @param tgt_sents (list[str]): Target sentences provided by read_corpus() function
        @param vocab_size (int): Size of vocabulary for both source and target languages
        @param freq_cutoff (int): if word occurs n < freq_cutoff times, drop the word.
Build Vocabulary.
Build Vocabulary .
def build(src_sents, tgt_sents, vocab_size, freq_cutoff) -> 'Vocab':
        """ Build Vocabulary.
        @param src_sents (list[str]): Source sentences provided by read_corpus() function
        @param tgt_sents (list[str]): Target sentences provided by read_corpus() function
        @param vocab_size (int): Size of vocabulary for both source and target languages
        @param freq_cutoff (int): if word occurs n < freq_cutoff times, drop the word.
        """
        assert len(src_sents) == len(tgt_sents)

        print('initialize source vocabulary ..')
        src = VocabEntry.from_corpus(src_sents, vocab_size, freq_cutoff)

        print('initialize target vocabulary ..')
        tgt = VocabEntry.from_corpus(tgt_sents, vocab_size, freq_cutoff)

        return Vocab(src, tgt)
def build ( src_sents , tgt_sents , vocab_size , freq_cutoff ) -> 'Vocab' : assert len ( src_sents ) == len ( tgt_sents ) print ( 'initialize source vocabulary ..' ) src = VocabEntry . from_corpus ( src_sents , vocab_size , freq_cutoff ) print ( 'initialize target vocabulary ..' ) tgt = VocabEntry . from_corpus ( tgt_sents , vocab_size , freq_cutoff ) return Vocab ( src , tgt )