def addPrefixes(self, data):
        prevTags = None
        newData = []

        for n, (token, tags) in enumerate(data):

            newTags = []

            for t in tags:
                p = "B" if ((prevTags is None) or (t not in prevTags)) else "I"
                newTags.append("%s-%s" % (p, t))

            newData.append((token, newTags))
            prevTags = tags

        return newData
We use BIO tagging/chunking to differentiate between tags
dataset/ETHPy150Open NYTimes/ingredient-phrase-tagger/lib/training/cli.py/Cli.addPrefixes