code: def cal_f1(c, p, r):
      if r == 0 or p == 0:
          return 0, 0, 0
  
      r = c / r if r else 0
      p = c / p if p else 0
  
      if r and p:
          return 2 * p * r / (p + r), p, r
      return 0, p, r
  
file_path: DeepKE/src/deepke/name_entity_re/standard/w2ner/utils.py
imports: import logging
  import pickle
  import time
  from collections import defaultdict, deque
label_desc: Use image node_id 7 for calling a global function with example usage: cal_f1(c, p, r) and returns: int,  p,  r, int,  int,  int, unknown,  p,  r