code: def _compute_f_pre_rec(beta_square, tp, fn, fp):
      r"""
  
      :param tp: int, true positive
      :param fn: int, false negative
      :param fp: int, false positive
      :return: (f, pre, rec)
      """
      pre = tp / (fp + tp + 1e-13)
      rec = tp / (fn + tp + 1e-13)
      f = (
          (1 + beta_square)
          * pre
          * rec
          / (beta_square * pre + rec + 1e-13)
      )
  
      return f, pre, rec
  
file_path: fastNLP/fastNLP/core/metrics/utils.py
imports: from typing import Any
  from functools import wraps
  from fastNLP.envs.imports import _NEED_IMPORT_PADDLE, _NEED_IMPORT_TORCH
  from fastNLP.envs.utils import _module_available
label_desc: Use image node_id 4 for calling a global function with example usage: _compute_f_pre_rec(beta_square, tp, fn, fp) and returns: f,  pre,  rec