def convert_iob_to_bio(seq):
    """Convert a sequence of IOB tags to BIO tags.

    The difference between IOB and BIO (also called IOB2) is that in IOB
    the B- prefix is only used to separate two chunks of the same type
    while in BIO the B- prefix is used to start every chunk.

    :param seq: `List[str]` The list of IOB tags.

    :returns: `List[str] The list of BIO tags.
    """
    new = []
    prev = 'O'
    for token in seq:
        # Only I- needs to be changed
        if token.startswith('I-'):
            # If last was O or last was a different type force B
            if prev == 'O' or token[2:] != prev[2:]:
                token = 'B-' + token[2:]
        new.append(token)
        prev = token
    return new