<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def correct(tokens, term_freq):
 """ Correct a list of tokens, according to the term_freq """

    log = []
    output = []
    for token in tokens:
        corrected = _correct(token, term_freq)
        if corrected != token:
            log.append((token, corrected))
        output.append(corrected)
    return output, log