class_docstr: 构建 **NG20** 数据集的 **Graph** 。
  
  :param graph_type: 
  :param widow_size:
  :param threshold:
class_docstr_tok: ["\u6784\u5efa","*","*","NG20","*","*","\u6570\u636e\u96c6\u7684","*","*","Graph","*","*","\u3002",":","param","graph_type",":",":","param","widow_size",":",":","param","threshold",":"]
docstr: :param data_bundle: 需要处理的 :class:`~fastNLP.io.DataBundle` 对象。
  :return: 返回 ``csr`` 类型的稀疏矩阵图；包含训练集，验证集，测试集，在图中的 index 。
docstr_tok: [":","param","data_bundle",":","\u9700\u8981\u5904\u7406\u7684",":","class",":","`","~fastNLP.io.DataBundle","`","\u5bf9\u8c61\u3002",":","return",":","\u8fd4\u56de","``","csr","``","\u7c7b\u578b\u7684\u7a00\u758f\u77e9\u9635\u56fe\uff1b\u5305\u542b\u8bad\u7ec3\u96c6\uff0c\u9a8c\u8bc1\u96c6\uff0c\u6d4b\u8bd5\u96c6\uff0c\u5728\u56fe\u4e2d\u7684","index","\u3002"]
code: def build_graph(self, data_bundle: DataBundle):
      r"""
      :param data_bundle: 需要处理的 :class:`~fastNLP.io.DataBundle` 对象。
      :return: 返回 ``csr`` 类型的稀疏矩阵图；包含训练集，验证集，测试集，在图中的 index 。
      """
      self._get_doc_edge(data_bundle)
      self._get_word_edge()
      return nx.to_scipy_sparse_matrix(
          self.graph,
          nodelist=list(range(self.graph.number_of_nodes())),
          weight="weight",
          dtype=np.float32,
          format="csr",
      ), (self.tr_doc_index, self.dev_doc_index, self.te_doc_index)
  
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 2 for calling the NG20PmiGraphPipe obj's underlying member method code with example usage: obj.build_graph(data_bundle) and returns: nx,  self,  self,  self