def iobes2iob(iobes):
    """Converts a list of IOBES tags to IOB scheme."""
    dico = {pfx: pfx for pfx in "IOB"}
    dico.update({"S": "B", "E": "I"})
    return [dico[t[0]] + t[1:] if not t == "O" else "O" for t in iobes]