docstr: 对输入的DataBundle进行处理，然后生成文档-单词的tfidf值
  ：param: data_bundle中的文本若为英文，形式为[ 'This is the first document.'],若为中文则为['他 喜欢 吃 苹果']
  : return 返回带有具有tfidf边文档-单词稀疏矩阵
docstr_tok: ["\u5bf9\u8f93\u5165\u7684DataBundle\u8fdb\u884c\u5904\u7406\uff0c\u7136\u540e\u751f\u6210\u6587\u6863-\u5355\u8bcd\u7684tfidf\u503c","\uff1aparam",":","data_bundle\u4e2d\u7684\u6587\u672c\u82e5\u4e3a\u82f1\u6587\uff0c\u5f62\u5f0f\u4e3a","[","'This","is","the","first","document",".","'","]",",","\u82e5\u4e3a\u4e2d\u6587\u5219\u4e3a","[","'","\u4ed6","\u559c\u6b22","\u5403","\u82f9\u679c","'","]",":","return","\u8fd4\u56de\u5e26\u6709\u5177\u6709tfidf\u8fb9\u6587\u6863-\u5355\u8bcd\u7a00\u758f\u77e9\u9635"]
code: def _get_doc_edge(self, data_bundle: DataBundle):
      r"""
      对输入的DataBundle进行处理，然后生成文档-单词的tfidf值
      ：param: data_bundle中的文本若为英文，形式为[ 'This is the first document.'],若为中文则为['他 喜欢 吃 苹果']
      : return 返回带有具有tfidf边文档-单词稀疏矩阵
      """
      tr_doc = list(
          data_bundle.get_dataset("train").get_field("raw_words")
      )
      val_doc = list(
          data_bundle.get_dataset("dev").get_field("raw_words")
      )
      te_doc = list(
          data_bundle.get_dataset("test").get_field("raw_words")
      )
      doc = tr_doc + val_doc + te_doc
      self.doc = doc
      self.tr_doc_index = [ind for ind in range(len(tr_doc))]
      self.dev_doc_index = [
          ind + len(tr_doc) for ind in range(len(val_doc))
      ]
      self.te_doc_index = [
          ind + len(tr_doc) + len(val_doc) for ind in range(len(te_doc))
      ]
      text_tfidf = Pipeline(
          [
              (
                  "count",
                  CountVectorizer(
                      token_pattern=r"\S+", min_df=1, max_df=1.0
                  ),
              ),
              (
                  "tfidf",
                  TfidfTransformer(
                      norm=None,
                      use_idf=True,
                      smooth_idf=False,
                      sublinear_tf=False,
                  ),
              ),
          ]
      )
  
      tfidf_vec = text_tfidf.fit_transform(doc)
      self.doc_node_num = tfidf_vec.shape[0]
      vocab_lst = text_tfidf["count"].get_feature_names()
      for ind, word in enumerate(vocab_lst):
          self.word2id[word] = ind
      for ind, row in enumerate(tfidf_vec):
          for col_index, value in zip(row.indices, row.data):
              self.graph.add_edge(
                  ind, self.doc_node_num + col_index, weight=value
              )
      return nx.to_scipy_sparse_matrix(self.graph)
  
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 GraphBuilderBase obj's underlying member method code with example usage: obj._get_doc_edge(data_bundle) and returns: nx