from typing import Counter


def read_vocab(corpus_file, thr):
    """
    Creates dictionary {token, count} for tokens appearing more than "thr" times
    """
    vocab = Counter()
    with open(corpus_file) as f:
        for line in f:
            vocab.update(Counter(line.strip().split()))
    return dict([(token, count) for token, count in vocab.items() if count >= thr])