code: def print_evaluation(y_test, predictions):
      """
      Print evaluation of the model's predictions comparing to the given y labels (if given)
  
      Args:
          y_test (list(str)): list of the labels given in the data
          predictions(obj:`numpy.ndarray`): the model's predictions
      """
      tp = 0.0
      fp = 0.0
      tn = 0.0
      fn = 0.0
      for y_true, prediction in zip(
          y_test, [round(p[0]) for p in predictions.tolist()]
      ):
          if prediction == 1:
              if y_true == 1:
                  tp = tp + 1
              else:
                  fp = fp + 1
          elif y_true == 0:
              tn = tn + 1
          else:
              fn = fn + 1
      if tp + fn == 0:
          fn = 1
      if tp == 0:
          tp = 1
      acc = 100 * ((tp + tn) / len(predictions))
      prec = 100 * (tp / (tp + fp))
      rec = 100 * (tp / (tp + fn))
      print(
          "Model statistics:\naccuracy: {0:.2f}\nprecision: {1:.2f}"
          "\nrecall: {2:.2f}\n".format(acc, prec, rec)
      )
  
file_path: nlp-architect/examples/np_semantic_segmentation/inference.py
imports: import argparse
  import csv
  import os
  from .data import NpSemanticSegData, absolute_path
  from nlp_architect.models.np_semantic_segmentation import NpSemanticSegClassifier
  from nlp_architect.utils.io import validate_existing_filepath, validate_parent_exists
label_desc: Use image node_id 2 for calling a global function with example usage: print_evaluation(y_test, predictions) without return types