class_docstr: Predictor for the :class:`~allennlp.models.bidaf.SemanticRoleLabeler` model.
docstr: Expects JSON that looks like ``{"sentence": "..."}``
  and returns JSON that looks like
  
  .. code-block:: js
  
      {"words": [...],
       "verbs": [
          {"verb": "...", "description": "...", "tags": [...]},
          ...
          {"verb": "...", "description": "...", "tags": [...]},
      ]}
docstr_tok: ["Expects","JSON","that","looks","like","``","{","``","sentence","''",":","``","...","''","}","``","and","returns","JSON","that","looks","like","..","code-block",":",":","js","{","``","words","''",":","[","...","]",",","``","verbs","''",":","[","{","``","verb","''",":","``","...","''",",","``","description","''",":","``","...","''",",","``","tags","''",":","[","...","]","}",",","...","{","``","verb","''",":","``","...","''",",","``","description","''",":","``","...","''",",","``","tags","''",":","[","...","]","}",",","]","}"]
code: def predict_json(self, inputs):
      """
      Expects JSON that looks like ``{"sentence": "..."}``
      and returns JSON that looks like
  
      .. code-block:: js
  
          {"words": [...],
           "verbs": [
              {"verb": "...", "description": "...", "tags": [...]},
              ...
              {"verb": "...", "description": "...", "tags": [...]},
          ]}
      """
      instances = self._sentence_to_srl_instances(inputs)
  
      if not instances:
          return sanitize(
              {
                  "verbs": [],
                  "words": self._tokenizer.split_words(
                      inputs["sentence"]
                  ),
              }
          )
  
      outputs = self._model.forward_on_instances(instances)
  
      results = {"verbs": [], "words": outputs[0]["words"]}
      for output in outputs:
          tags = output["tags"]
          description = self.make_srl_string(output["words"], tags)
          results["verbs"].append(
              {
                  "verb": output["verb"],
                  "description": description,
                  "tags": tags,
              }
          )
  
      return sanitize(results)
  
file_path: magnitude/pymagnitude/third_party/allennlp/predictors/semantic_role_labeler.py
imports: from __future__ import absolute_import
  from allennlp.common.util import JsonDict, sanitize, group_by_count
  from allennlp.data import DatasetReader, Instance
  from allennlp.data.tokenizers.word_splitter import SpacyWordSplitter
  from allennlp.models import Model
  from allennlp.predictors.predictor import Predictor
label_desc: Use image node_id 7 for calling the SemanticRoleLabelerPredictor obj's underlying member method code with example usage: obj.predict_json(inputs) and returns: sanitize, sanitize