How to reproduce the behaviour --------- <!-- Before submitting an issue, make sure to check the docs and closed issues and FAQ to see if any of the solutions work for you. --> <!-- Include a code example or the steps that led to the problem. Please try to be as specific as possible. --> Your Environment --------- <!-- Include details of your environment.--> * Operating System: * Python Version: * Package Version: seq = ['O', 'B-PER', 'I-LOC', 'O', 'B-LOC', 'I-PER'] print(get_entities(seq)) [('PER', 1, 1), ('LOC', 2, 2), ('LOC', 4, 4), ('PER', 5, 5)]