def METHOD_NAME(self, file_name: Path):
    samples = []
    with file_name.open(encoding="utf8") as f:
        tokens = []
        pos_tags = []
        chunk_tags = []
        tags = []
        expected_items = 2 + int(self.provide_pos) + int(self.provide_chunk)
        for line in f:
            # Check end of the document
            if "DOCSTART" in line:
                if len(tokens) > 1:
                    x = tokens if not self.x_is_tuple else (tokens,)
                    if self.provide_pos:
                        x = x + (pos_tags,)
                    if self.provide_chunk:
                        x = x + (chunk_tags,)
                    if self.provide_doc_ids:
                        x = x + (self.num_docs,)
                    samples.append((x, tags))
                    tokens = []
                    pos_tags = []
                    chunk_tags = []
                    tags = []
                self.num_docs += 1
                if self.docstart_token is not None:
                    tokens = [self.docstart_token]
                    pos_tags = ["O"]
                    chunk_tags = ["O"]
                    tags = ["O"]
            elif len(line) < 2:
                if (len(tokens) > 0) and (tokens != [self.docstart_token]):
                    x = tokens if not self.x_is_tuple else (tokens,)
                    if self.provide_pos:
                        x = x + (pos_tags,)
                    if self.provide_chunk:
                        x = x + (chunk_tags,)
                    if self.provide_doc_ids:
                        x = x + (self.num_docs,)
                    samples.append((x, tags))
                    tokens = []
                    pos_tags = []
                    chunk_tags = []
                    tags = []
            else:
                items = line.split()
                if len(items) < expected_items:
                    raise Exception(f"Input is not valid {line}")
                tokens.append(items[0])
                tags.append(items[-1])
                if self.provide_pos:
                    pos_tags.append(items[1])
                if self.provide_chunk:
                    chunk_tags.append(items[2])
        if tokens:
            x = tokens if not self.x_is_tuple else (tokens,)
            if self.provide_pos:
                x = x + (pos_tags,)
            if self.provide_chunk:
                x = x + (chunk_tags,)
            if self.provide_doc_ids:
                x = x + (self.num_docs,)
            samples.append((x, tags))
            self.num_docs += 1
        if self.iob:
            return [(x, self._iob2_to_iob(tags)) for x, tags in samples]
        if self.iobes:
            return [(x, self._iob2_to_iobes(tags)) for x, tags in samples]
    return samples