class_docstr: This pycrfsuite.Trainer prints information about each iteration
  on a single line.
class_docstr_tok: ["This","pycrfsuite.Trainer","prints","information","about","each","iteration","on","a","single","line","."]
code: def on_optimization_end(self, log):
      last_iter = self.logparser.last_iteration
      if last_iter.get("scores", None):
          data = [
              [
                  entity,
                  score.precision,
                  score.recall,
                  score.f1 or 0,
                  score.ref,
              ]
              for entity, score in sorted(last_iter["scores"].items())
          ]
          table = tabulate(
              data,
              headers=["Label", "Precision", "Recall", "F1", "Support"],
              floatfmt="0.3f",
          )
          size = len(table.splitlines()[0])
          print("=" * size)
          print(table)
          print("-" * size)
      super(LinePerIterationTrainer, self).on_optimization_end(log)
  
imports: import pycrfsuite
  from tabulate import tabulate
label_desc: Use image node_id 2 for calling the LinePerIterationTrainer obj's underlying member method code with example usage: obj.on_optimization_end(log) without return types