def mentions_to_IOB2(mention_list, sentence_length):
    """
    Convert json mentions to IOB2 tags.
    """
    tags = ['O'] * sentence_length
    for mention in mention_list:
        tags[mention['start']] = 'B-E'
        for i in range(mention['start'] + 1, mention['end']):
            tags[i] = 'I-E'
    return tags