code: def _count_pmi(
      windows_len, word_pair_count, word_window_freq, threshold
  ):
      r"""
      params: windows_len: 文本段数量
              word_pair_count: 词共现频率字典
              word_window_freq: 词频率字典
              threshold: 阈值
      return 词语pmi的list列表,其中元素为[word1, word2, pmi]
      """
      word_pmi_lst = list()
      task_id = f_rich_progress.add_task(
          description="Calculate pmi between words",
          total=len(word_pair_count),
      )
      for word_pair, W_i_j in word_pair_count.items():
          word_freq_1 = word_window_freq[word_pair[0]]
          word_freq_2 = word_window_freq[word_pair[1]]
  
          pmi = _cal_pmi(W_i_j, windows_len, word_freq_1, word_freq_2)
          if pmi <= threshold:
              continue
          word_pmi_lst.append([word_pair[0], word_pair[1], pmi])
  
          f_rich_progress.update(task_id, advance=1)
      f_rich_progress.destory_task(task_id)
      return word_pmi_lst
  
imports: from collections import defaultdict
  import itertools
  import math
  import numpy
  from ..data_bundle import DataBundle
  from ..loader.classification import MRLoader, OhsumedLoader, R52Loader, R8Loader, NG20Loader
  from fastNLP.core.utils import f_rich_progress
label_desc: Use image node_id 3 for calling a global function with example usage: _count_pmi(windows_len, word_pair_count, word_window_freq, threshold) and returns: word_pmi_lst