import collections


def get_vocab_from_dict(lines, tokenizer):
    """Gets a vocab from a dict of lines to their count.

    Returns:
        vocab (list): (word as a tuple of int, count), sorted descending by count
    """
    vocab = collections.Counter()

    for line, count in lines.items():
        words = tokenizer.tokenize(line)
        for word in words:
            vocab[word] += count

    vocab = list(vocab.items())
    vocab.sort(key=lambda k: k[1], reverse=True)
    return vocab