def METHOD_NAME(self, filename, *args):
    with open(filename, "r", encoding="utf-8") as f:
        tokens = []
        ner_tags = []
        pos_tags = []
        for line in f.readlines():
            if line.startswith("-DOCSTART-") or line == "" or line == "\n":
                if tokens:
                    yield {"tokens": tokens, "ner_tags": ner_tags, "pos_tags": pos_tags}
                    tokens = []
                    ner_tags = []
                    pos_tags = []
            else:
                # conll2002 tokens are space separated
                splits = line.split(" ")
                tokens.append(splits[0])
                pos_tags.append(splits[1])
                ner_tags.append(splits[2].rstrip())
        # last example
        yield {"tokens": tokens, "ner_tags": ner_tags, "pos_tags": pos_tags}