class_docstr: This DatasetReader is designed to read in the English OntoNotes v5.0 data
  for semantic role labelling. It returns a dataset of instances with the
  following fields:
  
  tokens : ``TextField``
      The tokens in the sentence.
  verb_indicator : ``SequenceLabelField``
      A sequence of binary indicators for whether the word is the verb for this frame.
  tags : ``SequenceLabelField``
      A sequence of Propbank tags for the given verb in a BIO format.
  
  Parameters
  ----------
  token_indexers : ``Dict[str, TokenIndexer]``, optional
      We similarly use this for both the premise and the hypothesis.  See :class:`TokenIndexer`.
      Default is ``{"tokens": SingleIdTokenIndexer()}``.
  domain_identifier: ``str``, (default = None)
      A string denoting a sub-domain of the Ontonotes 5.0 dataset to use. If present, only
      conll files under paths containing this domain identifier will be processed.
  
  Returns
  -------
  A ``Dataset`` of ``Instances`` for Semantic Role Labelling.
class_docstr_tok: ["This","DatasetReader","is","designed","to","read","in","the","English","OntoNotes","v5.0","data","for","semantic","role","labelling",".","It","returns","a","dataset","of","instances","with","the","following","fields",":","tokens",":","``","TextField","``","The","tokens","in","the","sentence",".","verb_indicator",":","``","SequenceLabelField","``","A","sequence","of","binary","indicators","for","whether","the","word","is","the","verb","for","this","frame",".","tags",":","``","SequenceLabelField","``","A","sequence","of","Propbank","tags","for","the","given","verb","in","a","BIO","format",".","Parameters","--","--","--","--","--","token_indexers",":","``","Dict","[","str",",","TokenIndexer","]","``",",","optional","We","similarly","use","this","for","both","the","premise","and","the","hypothesis",".","See",":","class",":","`","TokenIndexer","`",".","Default","is","``","{","``","tokens","''",":","SingleIdTokenIndexer","(",")","}","``",".","domain_identifier",":","``","str","``",",","(","default","=","None",")","A","string","denoting","a","sub-domain","of","the","Ontonotes","5.0","dataset","to","use",".","If","present",",","only","conll","files","under","paths","containing","this","domain","identifier","will","be","processed",".","Returns","--","--","--","-","A","``","Dataset","``","of","``","Instances","``","for","Semantic","Role","Labelling","."]
docstr: We take `pre-tokenized` input here, along with a verb label.  The verb label should be a
  one-hot binary vector, the same length as the tokens, indicating the position of the verb
  to find arguments for.
docstr_tok: ["We","take","`","pre-tokenized","`","input","here",",","along","with","a","verb","label",".","The","verb","label","should","be","a","one-hot","binary","vector",",","the","same","length","as","the","tokens",",","indicating","the","position","of","the","verb","to","find","arguments","for","."]
code: def text_to_instance(
      self, tokens, verb_label, tags=None  # type: ignore
  ):
      """
      We take `pre-tokenized` input here, along with a verb label.  The verb label should be a
      one-hot binary vector, the same length as the tokens, indicating the position of the verb
      to find arguments for.
      """
      # pylint: disable=arguments-differ
      fields = {}
      text_field = TextField(
          tokens, token_indexers=self._token_indexers
      )
      fields["tokens"] = text_field
      fields["verb_indicator"] = SequenceLabelField(
          verb_label, text_field
      )
      if tags:
          fields["tags"] = SequenceLabelField(tags, text_field)
  
      if all([x == 0 for x in verb_label]):
          verb = None
      else:
          verb = tokens[verb_label.index(1)].text
      fields["metadata"] = MetadataField(
          {"words": [x.text for x in tokens], "verb": verb}
      )
      return Instance(fields)
  
file_path: magnitude/pymagnitude/third_party/allennlp/data/dataset_readers/semantic_role_labeling.py
imports: from __future__ import absolute_import
  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, SequenceLabelField, MetadataField
  from allennlp.data.instance import Instance
  from allennlp.data.token_indexers import SingleIdTokenIndexer, TokenIndexer
  from allennlp.data.tokenizers import Token
  from allennlp.data.dataset_readers.dataset_utils import Ontonotes, OntonotesSentence
label_desc: Use image node_id 4 for calling the SrlReader obj's underlying member method code with example usage: obj.text_to_instance(tokens, verb_label, tags) and returns: Instance