'Load bAbI dataset and extract text and read the stories
For a particular task, the class will read both train and test files
and combine the vocabulary.
Arguments:
path (str): Directory to store the dataset
task (str): a particular task to solve (all bAbI tasks are train
and tested separately)
subset (str): subset of the dataset to use:
{en, en-10k, shuffled, hn, hn-10k, shuffled-10k}'

def __init__(self, path='.', task='qa1_single-supporting-fact', subset='en'):

    url = 'http://www.thespermwhale.com/jaseweston/babi'
    size = 11745123
    filename = 'tasks_1-20_v1-2.tar.gz'
    super(BABI, self).__init__(filename, url, size, path=path)
    self.task = task
    self.subset = subset
    neon_logger.display(('Preparing    bAbI    dataset    or    extracting    from    %s' % path))
    neon_logger.display(('Task    is    %s/%s' % (subset, task)))
    self.tasks = ['qa1_single-supporting-fact', 'qa2_two-supporting-facts', 'qa3_three-supporting-facts', 'qa4_two-arg-relations', 'qa5_three-arg-relations', 'qa6_yes-no-questions', 'qa7_counting', 'qa8_lists-sets', 'qa9_simple-negation', 'qa10_indefinite-knowledge', 'qa11_basic-coreference', 'qa12_conjunction', 'qa13_compound-coreference', 'qa14_time-reasoning', 'qa15_basic-deduction', 'qa16_basic-induction', 'qa17_positional-reasoning', 'qa18_size-reasoning', 'qa19_path-finding', 'qa20_agents-motivations']
    assert (task in self.tasks), 'given    task    is    not    in    the    bAbI    dataset'
    (self.train_file, self.test_file) = self.load_data(path, task)
    self.train_parsed = BABI.parse_babi(self.train_file)
    self.test_parsed = BABI.parse_babi(self.test_file)
    self.compute_statistics()
    self.train = self.vectorize_stories(self.train_parsed)
    self.test = self.vectorize_stories(self.test_parsed)
