@staticmethod
    def parse_babi(babi_file):
        babi_data = open(babi_file).read()
        lines = BABI.data_to_list(babi_data)

        data, story = [], []
        for line in lines:
            nid, line = line.split(' ', 1)
            if int(nid) == 1:
                story = []
            if '\t' in line:
                q, a, supporting = line.split('\t')
                substory = [x for x in story if x]
                data.append((substory, BABI.tokenize(q), a))
                story.append('')
            else:
                sent = BABI.tokenize(line)
                story.append(sent)

        return [(BABI.flatten(_story), _question, answer) for _story, _question, answer in data]
%prog fasta bedfile scf.fasta pseudomolecules.fasta
dataset/ETHPy150Open NervanaSystems/neon/neon/data/questionanswer.py/BABI.parse_babi--crossover with--dataset/ETHPy150Open tanghaibao/jcvi/assembly/opticalmap.py/fasta