class_docstr: Reads a file from the Stanford Natural Language Inference (SNLI) dataset.  This data is
  formatted as jsonl, one json-formatted instance per line.  The keys in the data are
  "gold_label", "sentence1", and "sentence2".  We convert these keys into fields named "label",
  "premise" and "hypothesis", along with a metadata field containing the tokenized strings of the
  premise and hypothesis.
  
  Parameters
  ----------
  tokenizer : ``Tokenizer``, optional (default=``WordTokenizer()``)
      We use this ``Tokenizer`` for both the premise and the hypothesis.  See :class:`Tokenizer`.
  token_indexers : ``Dict[str, TokenIndexer]``, optional (default=``{"tokens": SingleIdTokenIndexer()}``)
      We similarly use this for both the premise and the hypothesis.  See :class:`TokenIndexer`.
code: def text_to_instance(
      self, premise, hypothesis, label=None  # type: ignore
  ):
      # pylint: disable=arguments-differ
      fields = {}
      premise_tokens = self._tokenizer.tokenize(premise)
      hypothesis_tokens = self._tokenizer.tokenize(hypothesis)
      fields["premise"] = TextField(
          premise_tokens, self._token_indexers
      )
      fields["hypothesis"] = TextField(
          hypothesis_tokens, self._token_indexers
      )
      if label:
          fields["label"] = LabelField(label)
  
      metadata = {
          "premise_tokens": [x.text for x in premise_tokens],
          "hypothesis_tokens": [x.text for x in hypothesis_tokens],
      }
      fields["metadata"] = MetadataField(metadata)
      return Instance(fields)
  
file_path: magnitude/pymagnitude/third_party/allennlp/data/dataset_readers/snli.py
imports: from __future__ import with_statement
  from __future__ import absolute_import
  import json
  import logging
  from allennlp.common.file_utils import cached_path
  from allennlp.data.dataset_readers.dataset_reader import DatasetReader
  from allennlp.data.fields import Field, TextField, LabelField, MetadataField
  from allennlp.data.instance import Instance
  from allennlp.data.token_indexers import SingleIdTokenIndexer, TokenIndexer
  from allennlp.data.tokenizers import Tokenizer, WordTokenizer
  from io import open
label_desc: Use image node_id 3 for calling the SnliReader obj's underlying member method code with example usage: obj.text_to_instance(premise, hypothesis, label) and returns: Instance