def precision(reference, test):
    if (not hasattr(reference, 'intersection') or
        not hasattr(test, 'intersection')):
        raise TypeError('reference and test should be sets')

    if len(test) == 0:
        return None
    else:
        return len(reference.intersection(test)) / len(test)
Given a set of reference values and a set of test values, return
dataset/ETHPy150Open nltk/nltk/nltk/metrics/scores.py/precision