code: def test_uses_named_inputs(self):
      inputs = {
          "sentence": "The squirrel wrote a unit test to make sure its nuts worked as designed."
      }
  
      archive = load_archive(
          self.FIXTURES_ROOT / "srl" / "serialization" / "model.tar.gz"
      )
      predictor = Predictor.from_archive(
          archive, "semantic-role-labeling"
      )
  
      result = predictor.predict_json(inputs)
  
      words = result.get("words")
      assert words == [
          "The",
          "squirrel",
          "wrote",
          "a",
          "unit",
          "test",
          "to",
          "make",
          "sure",
          "its",
          "nuts",
          "worked",
          "as",
          "designed",
          ".",
      ]
      num_words = len(words)
  
      verbs = result.get("verbs")
      assert verbs is not None
      assert isinstance(verbs, list)
  
      assert any(v["verb"] == "wrote" for v in verbs)
      assert any(v["verb"] == "make" for v in verbs)
      assert any(v["verb"] == "worked" for v in verbs)
  
      for verb in verbs:
          tags = verb.get("tags")
          assert tags is not None
          assert isinstance(tags, list)
          assert all(isinstance(tag, unicode) for tag in tags)
          assert len(tags) == num_words
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/predictors/srl_test.py
imports: from __future__ import division
  from __future__ import absolute_import
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.models.archival import load_archive
  from allennlp.predictors import Predictor
label_desc: Use image node_id 1 for calling the TestSrlPredictor obj's underlying member method code with example usage: obj.test_uses_named_inputs() without return types