from typing import Counter


def term_freq(tokens):
    """
    Takes in a list of tokens (str) and return a dictionary of term frequency of each token
    tf(t,d) = count of t in d / number of words in d
    """
    token_counts = Counter([token for token in tokens])
    term_freq = ([(token, count/len(tokens)) for token, count in token_counts.items()])
    return(term_freq)