code: def test_dependency_parsing(self):
      predictor = demo_model(*DEFAULT_MODELS["dependency-parsing"])
      sentence = """He ate spaghetti with chopsticks."""
      result = predictor.predict_json({"sentence": sentence})
      # Note that this tree is incorrect. We are checking here that the decoded
      # tree is _actually a tree_ - in greedy decoding versions of the dependency
      # parser, this sentence has multiple heads. This test shouldn't really live here,
      # but it's very difficult to re-create a concrete example of this behaviour without
      # a trained dependency parser.
      assert result["words"] == [
          "He",
          "ate",
          "spaghetti",
          "with",
          "chopsticks",
          ".",
      ]
      assert result["pos"] == ["PRP", "VBD", "NNS", "IN", "NNS", "."]
      assert result["predicted_dependencies"] == [
          "nsubj",
          "root",
          "acomp",
          "prep",
          "pobj",
          "punct",
      ]
      assert result["predicted_heads"] == [3, 0, 2, 3, 4, 2]
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/models/sniff_test.py
imports: from __future__ import absolute_import
  from __future__ import print_function
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.models.archival import load_archive
  from allennlp.predictors import Predictor
label_desc: Use image node_id 7 for calling the SniffTest obj's underlying member method code with example usage: obj.test_dependency_parsing() without return types