code: def trec_dataset():
      import torchtext
  
      try:
          from torchtext import data
  
          text_field = data.Field(lower=True)
          label_field = data.Field(sequential=False, unk_token=None)
          train, test = torchtext.datasets.TREC.splits(
              text_field, label_field
          )
      except AttributeError:
          # torchtext >= 0.8.0
          from torchtext.legacy import data
  
          text_field = data.Field(lower=True)
          label_field = data.Field(sequential=False, unk_token=None)
          train, test = torchtext.legacy.datasets.TREC.splits(
              text_field, label_field
          )
  
      text_field.build_vocab(train)
      label_field.build_vocab(train)
  
      return _dataset_to_text_classification_dataset(
          train
      ), _dataset_to_text_classification_dataset(test)
  
imports: import string
  import numpy
  from collections import Counter
  from scipy import sparse
  from sklearn.datasets import fetch_20newsgroups
  from small_text.data.datasets import SklearnDataset, TextDataset
  from small_text.data.sampling import _get_class_histogram
  from small_text.utils.labels import csr_to_list, list_to_csr
label_desc: Use image node_id 6 for calling a global function with example usage: trec_dataset() and returns: _dataset_to_text_classification_dataset,  _dataset_to_text_classification_dataset