class_docstr: This ``DatasetReader`` takes json files and converts them into ``Instances`` for the
  ``AtisSemanticParser``.
  
  Each line in the file is a JSON object that represent an interaction in the ATIS dataset
  that has the following keys and values:
  ```
  "id": The original filepath in the LDC corpus
  "interaction": <list where each element represents a turn in the interaction>
  "scenario": A code that refers to the scenario that served as the prompt for this interaction
  "ut_date": Date of the interaction
  "zc09_path": Path that was used in the original paper `Learning Context-Dependent Mappings from
  Sentences to Logical Form
  <https://www.semanticscholar.org/paper/Learning-Context-Dependent-Mappings-from-Sentences-Zettlemoyer-Collins/44a8fcee0741139fa15862dc4b6ce1e11444878f>'_ by Zettlemoyer and Collins (ACL/IJCNLP 2009)
  ```
  
  Each element in the ``interaction`` list has the following keys and values:
  ```
  "utterance": Natural language input
  "sql": A list of SQL queries that the utterance maps to, it could be multiple SQL queries
  or none at all.
  ```
  
  Parameters
  ----------
  token_indexers : ``Dict[str, TokenIndexer]``, optional
      Token indexers for the utterances. Will default to ``{"tokens": SingleIdTokenIndexer()}``.
  lazy : ``bool`` (optional, default=False)
      Passed to ``DatasetReader``.  If this is ``True``, training will start sooner, but will
      take longer per batch.
  tokenizer : ``Tokenizer``, optional
      Tokenizer to use for the utterances. Will default to ``WordTokenizer()`` with Spacy's tagger
      enabled.
class_docstr_tok: ["This","``","DatasetReader","``","takes","json","files","and","converts","them","into","``","Instances","``","for","the","``","AtisSemanticParser","``",".","Each","line","in","the","file","is","a","JSON","object","that","represent","an","interaction","in","the","ATIS","dataset","that","has","the","following","keys","and","values",":","``","`","''","id","''",":","The","original","filepath","in","the","LDC","corpus","''","interaction","''",":","<","list","where","each","element","represents","a","turn","in","the","interaction",">","''","scenario","''",":","A","code","that","refers","to","the","scenario","that","served","as","the","prompt","for","this","interaction","''","ut_date","''",":","Date","of","the","interaction","''","zc09_path","''",":","Path","that","was","used","in","the","original","paper","`","Learning","Context-Dependent","Mappings","from","Sentences","to","Logical","Form","<","https",":","\/\/www.semanticscholar.org\/paper\/Learning-Context-Dependent-Mappings-from-Sentences-Zettlemoyer-Collins\/44a8fcee0741139fa15862dc4b6ce1e11444878f",">","'","_","by","Zettlemoyer","and","Collins","(","ACL\/IJCNLP","2009",")","``","`","Each","element","in","the","``","interaction","``","list","has","the","following","keys","and","values",":","``","`","''","utterance","''",":","Natural","language","input","''","sql","''",":","A","list","of","SQL","queries","that","the","utterance","maps","to",",","it","could","be","multiple","SQL","queries","or","none","at","all",".","``","`","Parameters","--","--","--","--","--","token_indexers",":","``","Dict","[","str",",","TokenIndexer","]","``",",","optional","Token","indexers","for","the","utterances",".","Will","default","to","``","{","``","tokens","''",":","SingleIdTokenIndexer","(",")","}","``",".","lazy",":","``","bool","``","(","optional",",","default=False",")","Passed","to","``","DatasetReader","``",".","If","this","is","``","True","``",",","training","will","start","sooner",",","but","will","take","longer","per","batch",".","tokenizer",":","``","Tokenizer","``",",","optional","Tokenizer","to","use","for","the","utterances",".","Will","default","to","``","WordTokenizer","(",")","``","with","Spacy","'s","tagger","enabled","."]
code: def _read(self, file_path):
      # if `file_path` is a URL, redirect to the cache
      file_path = cached_path(file_path)
  
      with open(file_path) as atis_file:
          logger.info(
              "Reading ATIS instances from dataset at : %s", file_path
          )
          for line in _lazy_parse(atis_file.read()):
              utterances = []
              for current_interaction in line["interaction"]:
                  if not current_interaction["utterance"]:
                      continue
                  utterances.append(current_interaction["utterance"])
                  instance = self.text_to_instance(
                      utterances, current_interaction["sql"]
                  )
                  if not instance:
                      continue
                  yield instance
  
file_path: magnitude/pymagnitude/third_party/allennlp/data/dataset_readers/atis.py
imports: from __future__ import with_statement
  from __future__ import absolute_import
  import json
  import logging
  from parsimonious.exceptions import ParseError
  from allennlp.common.file_utils import cached_path
  from allennlp.data.dataset_readers.dataset_reader import DatasetReader
  from allennlp.data.fields import Field, ArrayField, ListField, IndexField, ProductionRuleField, TextField, MetadataField
  from allennlp.data.instance import Instance
  from allennlp.data.token_indexers import SingleIdTokenIndexer, TokenIndexer
  from allennlp.data.tokenizers import Tokenizer, WordTokenizer
  from allennlp.data.tokenizers.word_splitter import SpacyWordSplitter
  from allennlp.semparse.worlds.atis_world import AtisWorld
  from io import open
label_desc: Use image node_id 2 for calling the AtisDatasetReader obj's underlying member method code with example usage: obj._read(file_path) without return types