from typing import List
from typing import Counter


def term_freq(tokens: List[str]) -> dict:
    """
    Takes in a list of tokens (str) and return a dictionary of term frequency of each token
    """
    freq = dict(Counter(tokens))
    return {k: freq[k] / len(tokens) for k in freq}