code: def score_dependencies(args):
      if args["lang"] != "en":
          raise ValueError(
              "Converting and scoring dependencies is currently only supported for English"
          )
  
      constituency_package = "wsj_bert"
      pipeline_args = {
          "lang": args["lang"],
          "tokenize_pretokenized": True,
          "package": {
              "pos": args["retag_package"],
              "depparse": "converter",
              "constituency": constituency_package,
          },
          "processors": "tokenize, pos, constituency, depparse",
      }
      pipeline = stanza.Pipeline(**pipeline_args)
  
      input_doc = CoNLL.conll2doc(args["eval_file"])
      output_doc = pipeline(input_doc)
      print("Processed %d sentences" % len(output_doc.sentences))
      # reload - the pipeline clobbered the gold values
      input_doc = CoNLL.conll2doc(args["eval_file"])
  
      scorer.score_named_dependencies(output_doc, input_doc)
      with tempfile.TemporaryDirectory() as tempdir:
          output_path = os.path.join(tempdir, "converted.conll")
  
          CoNLL.write_doc2conll(output_doc, output_path)
  
          _, _, score = scorer.score(output_path, args["eval_file"])
  
          print("Parser score:")
          print("{} {:.2f}".format(constituency_package, score * 100))
  
file_path: stanza/stanza/models/constituency/score_converted_dependencies.py
imports: import argparse
  import os
  import tempfile
  import stanza
  from stanza.models.constituency import retagging
  from stanza.models.depparse import scorer
  from stanza.utils.conll import CoNLL
label_desc: Use image node_id 1 for calling a global function with example usage: score_dependencies(args) without return types