from typing import Counter


def count_oov(tokens, vocab):
    """
    计算oov的单词
    :param tokens: 所有token单词
    :param vocab: 生成的单词表中的单词
    :return:  int， int， 返回所有单词数和所有不在vocab中的单词数
    """
    c = Counter(t for t in tokens)
    total = sum(c.values())
    matched = sum(c[t] for t in vocab)
    return total, total-matched