code: def readfile(filename):
      """
      read file
      """
      f = open(filename, encoding="utf-8")
      data = []
      sentence = []
      label = []
      for line in f:
          if (
              len(line) == 0
              or line.startswith("-DOCSTART")
              or line[0] == "\n"
          ):
              if len(sentence) > 0:
                  data.append((sentence, label))
                  sentence = []
                  label = []
              continue
          splits = line.strip().split()
          sentence.append(splits[0])
          label.append(splits[-1])
  
      if len(sentence) > 0:
          data.append((sentence, label))
          sentence = []
          label = []
      return data
  
file_path: DeepKE/src/deepke/name_entity_re/standard/tools/dataset.py
imports: import torch
label_desc: Use image node_id 1 for calling a global function with example usage: readfile(filename) and returns: data