code: def test_evalb_with_terrible_trees_handles_nan_f1(self):
      # If precision and recall are zero, evalb returns nan f1.
      # This checks that we handle the zero division.
      tree1 = Tree.fromstring(
          "(PP (VROOT (PP That) (VROOT (PP could) "
          "(VROOT (PP cost) (VROOT (PP him))))) (PP .))"
      )
      tree2 = Tree.fromstring(
          "(S (NP (D the) (N dog)) (VP (V chased) (NP (D the) (N cat))))"
      )
      evalb_scorer = EvalbBracketingScorer()
      evalb_scorer([tree1], [tree2])
      metrics = evalb_scorer.get_metric()
      assert metrics["evalb_recall"] == 0.0
      assert metrics["evalb_precision"] == 0.0
      assert metrics["evalb_f1_measure"] == 0.0
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/training/metrics/evalb_bracketing_scorer_test.py
imports: from __future__ import absolute_import
  from nltk import Tree
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.training.metrics import EvalbBracketingScorer
label_desc: Use image node_id 6 for calling the EvalbBracketingScorerTest obj's underlying member method code with example usage: obj.test_evalb_with_terrible_trees_handles_nan_f1() without return types