from typing import Counter


def build_vocab(train_corpus):
    """
    Build a vocabulary with word frequencies for an entire corpus.
    Returns: {word : (ID, frequency)}
    """

    vocab = Counter()
    for line in train_corpus:
        for tokens in line:
            vocab.update([tokens])

    return {word: (i, freq) for i, (word, freq) in enumerate(vocab.items())}