def translate_tags_IOB_to_grobid(tag: str) -> str:
    """
    Convert labels from IOB2 to the ones used by GROBID (expected by the wapiti model)
    """
    if tag == 'O':
        # outside
        return '<other>'
    elif tag.startswith('B-'):
        # begin
        return 'I-' + tag[2:]
    elif tag.startswith('I-'):
        # inside
        return '' + tag[2:]
    else:
        return tag