class_docstr: Sentence-level relation extraction dataset
docstr: Args:
      path: path of the input file
      rel2id: dictionary of relation->id mapping
      tokenizer: function of tokenizing
docstr_tok: ["Args",":","path",":","path","of","the","input","file","rel2id",":","dictionary","of","relation-",">","id","mapping","tokenizer",":","function","of","tokenizing"]
code: def __init__(self, path, rel2id, tokenizer, kwargs):
      """
      Args:
          path: path of the input file
          rel2id: dictionary of relation->id mapping
          tokenizer: function of tokenizing
      """
      super().__init__()
      self.path = path
      self.tokenizer = tokenizer
      self.rel2id = rel2id
      self.kwargs = kwargs
  
      # Load the file
      f = open(path)
      self.data = []
      for line in f.readlines():
          line = line.rstrip()
          if len(line) > 0:
              self.data.append(eval(line))
      f.close()
      logging.info(
          "Loaded sentence RE dataset {} with {} lines and {} relations.".format(
              path, len(self.data), len(self.rel2id)
          )
      )
  
imports: import torch
  import torch.utils.data
  import os, random, json, logging
  import numpy
  import sklearn.metrics
label_desc: Use image node_id 1 to create a new MultiLabelSentenceREDataset object from inherited base classes: data with example: obj = MultiLabelSentenceREDataset(path, rel2id, tokenizer, kwargs)