class_docstr:     Calculate precision, recall, F1 for each labels
  
  Parameters
  ----------
  metrics: list
      Indicate the metric for the class to return.
      Note that each metric must be one of ``precision``, ``recall``, ``F1``, ``accuracy``.
      And the results' order is the same as the metrics.
class_docstr_tok: ["Calculate","precision",",","recall",",","F1","for","each","labels","Parameters","--","--","--","--","--","metrics",":","list","Indicate","the","metric","for","the","class","to","return",".","Note","that","each","metric","must","be","one","of","``","precision","``",",","``","recall","``",",","``","F1","``",",","``","accuracy","``",".","And","the","results","'","order","is","the","same","as","the","metrics","."]
code: def __init__(self, metrics):
      super().__init__()
      if isinstance(metrics, list):
          for metric in metrics:
              if metric not in [
                  "precision",
                  "recall",
                  "F1",
                  "accuracy",
              ]:
                  raise TypeError(
                      "argument metric must be list of str containing "
                      "'precision', 'recall', 'F1', 'accuracy'"
                  )
      self.metrics = metrics
  
file_path: graph4nlp/graph4nlp/pytorch/modules/evaluation/accuracy.py
imports: import copy
  import warnings
  import numpy
  import torch
  from graph4nlp.pytorch.modules.evaluation.base import EvaluationMetricBase
label_desc: Use image node_id 1 to create a new Accuracy object from inherited base classes: EvaluationMetricBase with example: obj = Accuracy(metrics)