def accuracy(y_pred, y, tags):
    """
    Returns the accuracy of a classifier 
    """
    o_id = tags.index("O") if "O" in tags else None
    correct = ignore = 0
    for i, tag_id in enumerate(y):
        if y_pred[i] == y[i]:
            if tag_id == o_id:
                ignore += 1
            else:
                correct += 1
    return float(correct)/(len(y) - ignore)