def get_coherent_next_tag(prev_label: str, cur_label: str) ->str:
    """
    Generate a coherent tag, given previous tag and current label.
    """
    if cur_label == 'O':
        return 'O'
    if prev_label == cur_label:
        return f'I-{cur_label}'
    else:
        return f'B-{cur_label}'
