def parse_tf_answer(model_answer):
    """
    Extract 'T' or 'F' from the tf type model_answer.
    Supports formats like 'T', 'F', 'True', 'False'; returns an error flag if multiple matches are found.
    """
    pattern = re.compile(r'\b(t|f|true|false)\b', re.IGNORECASE)
    matches = pattern.findall(model_answer)
    extracted = [match.upper()[0] for match in matches]
    if len(extracted) == 1:
        return extracted[0], None
    elif len(extracted) > 1:
        return None, 'multiple_answers_found'
    else:
        return None, 'no_answer_found'

    Extract 'T' or 'F' from the tf type model_answer.
    Supports formats like 'T', 'F', 'True', 'False'; returns an error flag if multiple matches are found.
    
vlmeval/dataset/utils/vlm2bench.py