class_docstr: 构建 **R8** 数据集的 **Graph** 。
  
  :param graph_type: 
  :param widow_size:
  :param threshold:
class_docstr_tok: ["\u6784\u5efa","*","*","R8","*","*","\u6570\u636e\u96c6\u7684","*","*","Graph","*","*","\u3002",":","param","graph_type",":",":","param","widow_size",":",":","param","threshold",":"]
docstr: 传入文件路径，生成处理好的 ``scipy_sparse_matrix`` 对象。``paths`` 支持的路径形式可以参考 :meth:`fastNLP.io.Loader.load`
  
  :param path: 数据集的路径。
  :return: 返回 ``csr`` 类型的稀疏矩阵图；包含训练集，验证集，测试集，在图中的 index 。
docstr_tok: ["\u4f20\u5165\u6587\u4ef6\u8def\u5f84\uff0c\u751f\u6210\u5904\u7406\u597d\u7684","``","scipy_sparse_matrix","``","\u5bf9\u8c61\u3002","``","paths","``","\u652f\u6301\u7684\u8def\u5f84\u5f62\u5f0f\u53ef\u4ee5\u53c2\u8003",":","meth",":","`","fastNLP.io.Loader.load","`",":","param","path",":","\u6570\u636e\u96c6\u7684\u8def\u5f84\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_from_file(self, path: str):
      r"""
      传入文件路径，生成处理好的 ``scipy_sparse_matrix`` 对象。``paths`` 支持的路径形式可以参考 :meth:`fastNLP.io.Loader.load`
  
      :param path: 数据集的路径。
      :return: 返回 ``csr`` 类型的稀疏矩阵图；包含训练集，验证集，测试集，在图中的 index 。
      """
      data_bundle = R8Loader().load(path)
      return self.build_graph(data_bundle)
  
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 the R8PmiGraphPipe obj's underlying member method code with example usage: obj.build_graph_from_file(path) and returns: self