class_docstr: Reads one single task in the bAbI tasks format as formulated in
  Towards AI-Complete Question Answering: A Set of Prerequisite Toy Tasks
  (https://arxiv.org/abs/1502.05698). Since this class handle a single file,
  if one wants to load multiple tasks together it has to merge them into a
  single file and use this reader.
  
  Registered as a `DatasetReader` with name "babi".
  
  # Parameters
  
  keep_sentences : `bool`, optional, (default = `False`)
      Whether to keep each sentence in the context or to concatenate them.
      Default is `False` that corresponds to concatenation.
  token_indexers : `Dict[str, TokenIndexer]`, optional (default=`{"tokens": SingleIdTokenIndexer()}`)
      We use this to define the input representation for the text.  See :class:`TokenIndexer`.
class_docstr_tok: ["Reads","one","single","task","in","the","bAbI","tasks","format","as","formulated","in","Towards","AI-Complete","Question","Answering",":","A","Set","of","Prerequisite","Toy","Tasks","(","https",":","\/\/arxiv.org\/abs\/1502.05698",")",".","Since","this","class","handle","a","single","file",",","if","one","wants","to","load","multiple","tasks","together","it","has","to","merge","them","into","a","single","file","and","use","this","reader",".","Registered","as","a","`","DatasetReader","`","with","name","``","babi","''",".","#","Parameters","keep_sentences",":","`","bool","`",",","optional",",","(","default","=","`","False","`",")","Whether","to","keep","each","sentence","in","the","context","or","to","concatenate","them",".","Default","is","`","False","`","that","corresponds","to","concatenation",".","token_indexers",":","`","Dict","[","str",",","TokenIndexer","]","`",",","optional","(","default=","`","{","``","tokens","''",":","SingleIdTokenIndexer","(",")","}","`",")","We","use","this","to","define","the","input","representation","for","the","text",".","See",":","class",":","`","TokenIndexer","`","."]
code: def __init__(
      self,
      keep_sentences: bool = False,
      token_indexers: Dict[str, TokenIndexer] = None,
      **kwargs,
  ) -> None:
      super().__init__(**kwargs)
      self._keep_sentences = keep_sentences
      self._token_indexers = token_indexers or {
          "tokens": SingleIdTokenIndexer()
      }
  
file_path: allennlp/allennlp/data/dataset_readers/babi.py
imports: import logging
  from typing import Dict, List
  from allennlp.common.file_utils import cached_path
  from allennlp.data.dataset_readers.dataset_reader import DatasetReader, PathOrStr
  from allennlp.data.instance import Instance
  from allennlp.data.fields import Field, TextField, ListField, IndexField
  from allennlp.data.token_indexers import TokenIndexer, SingleIdTokenIndexer
  from allennlp.data.tokenizers import Token
label_desc: Use image node_id 1 to create a new BabiReader object from inherited base classes: DatasetReader with example: obj = BabiReader(keep_sentences, token_indexers)