code: def run_conllu_eval(
      gold_file, test_file, weights_file=WEIGHTS, verbose=True
  ):
      # Use verbose if weights are supplied
      if weights_file is not None and not verbose:
          verbose = True
  
      # Evaluate
      evaluation = evaluate_wrapper(gold_file, test_file, weights_file)
  
      # Write the evaluation to file
      with open(
          test_file[: test_file.rindex(".")] + "_eval.txt", "w"
      ) as out_file:
          if not verbose:
              out_file.write(
                  "LAS F1 Score: {:.2f}".format(
                      100 * evaluation["LAS"].f1
                  )
                  + "\n"
              )
          else:
              metrics = [
                  "Tokens",
                  "Sentences",
                  "Words",
                  "UPOS",
                  "XPOS",
                  "Feats",
                  "AllTags",
                  "Lemmas",
                  "UAS",
                  "LAS",
              ]
              if weights_file is not None:
                  metrics.append("WeightedLAS")
  
              out_file.write(
                  "Metrics    | Precision |    Recall |  F1 Score | AligndAcc"
                  + "\n"
              )
              out_file.write(
                  "-----------+-----------+-----------+-----------+-----------"
                  + "\n"
              )
              for metric in metrics:
                  out_file.write(
                      "{:11}|{:10.2f} |{:10.2f} |{:10.2f} |{}".format(
                          metric,
                          100 * evaluation[metric].precision,
                          100 * evaluation[metric].recall,
                          100 * evaluation[metric].f1,
                          "{:10.2f}".format(
                              100 * evaluation[metric].aligned_accuracy
                          )
                          if evaluation[metric].aligned_accuracy
                          is not None
                          else "",
                      )
                      + "\n"
                  )
  
file_path: nlp-architect/nlp_architect/models/bist/eval/conllu/conll17_ud_eval.py
imports: import os
  import sys
label_desc: Use image node_id 6 for calling a global function with example usage: run_conllu_eval(gold_file, test_file, weights_file, verbose) without return types