def LF_text_desc_match(c):
    args = c.get_contexts()
    if (len(args) != 2):
        raise NotImplementedError('Only handles binary candidates currently')
    (product, img) = args
    if (fuzz.partial_ratio(product.text, img.description) >= 70):
        return 1
    elif (fuzz.partial_ratio(product.text, img.description) <= 40):
        return (- 1)
    else:
        return 0
def LF_text_desc_match(c):
    args = c.get_contexts()
    if (len(args) != 2):
        raise NotImplementedError('Only handles binary candidates currently')
    (product, img) = args
    if (fuzz.partial_ratio(product.text, img.description) >= 70):
        return 1
    elif (fuzz.partial_ratio(product.text, img.description) <= 40):
        return (- 1)
    else:
        return 0