(vocabs, vocab_size=None)
return torchtext.vocab.Vocab(merged,
                                 specials=[UNK_WORD, PAD_WORD,
                                           BOS_WORD, EOS_WORD],
                                 max_size=vocab_size)
Merge individual vocabularies (assumed to be generated from disjoint
    documents) into a larger vocabulary.

    Args:
        vocabs: `torchtext.vocab.Vocab` vocabularies to be merged
        vocab_size: `int` the final vocabulary size. `None` for no limit.
    Return:
        `torchtext.vocab.Vocab`
Merge individual vocabularies (assumed to be generated from disjoint
    documents) into a larger vocabulary.
Merge individual vocabularies ( assumed to be generated from disjoint documents ) into a larger vocabulary .
def merge_vocabs(vocabs, vocab_size=None):
    """
    Merge individual vocabularies (assumed to be generated from disjoint
    documents) into a larger vocabulary.

    Args:
        vocabs: `torchtext.vocab.Vocab` vocabularies to be merged
        vocab_size: `int` the final vocabulary size. `None` for no limit.
    Return:
        `torchtext.vocab.Vocab`
    """
    merged = sum([vocab.freqs for vocab in vocabs], Counter())
    return torchtext.vocab.Vocab(merged,
                                 specials=[UNK_WORD, PAD_WORD,
                                           BOS_WORD, EOS_WORD],
                                 max_size=vocab_size)
def merge_vocabs ( vocabs , vocab_size = None ) : merged = sum ( [ vocab . freqs for vocab in vocabs ] , Counter ( ) ) return torchtext . vocab . Vocab ( merged , specials = [ UNK_WORD , PAD_WORD , BOS_WORD , EOS_WORD ] , max_size = vocab_size )