docstr: Read relations from csv or txt file.
  Each record is supposed to contain the following three fields in order:
  id1(string), id2(string) and label(int).
  
  For csv file, it should be without header.
  For txt file, each line should contain one record with fields separated by comma.
  
  :param path: The path to the relations file, which can either be a local or disrtibuted file
               system (such as HDFS) path.
  :param sc: An instance of SparkContext.
             If specified, return RDD of Relation.
             Default is None and in this case return list of Relation.
  :param min_partitions: Int. A suggestion value of the minimal partition number for input
                         texts. Only need to specify this when sc is not None. Default is 1.
docstr_tok: ["Read","relations","from","csv","or","txt","file",".","Each","record","is","supposed","to","contain","the","following","three","fields","in","order",":","id1","(","string",")",",","id2","(","string",")","and","label","(","int",")",".","For","csv","file",",","it","should","be","without","header",".","For","txt","file",",","each","line","should","contain","one","record","with","fields","separated","by","comma",".",":","param","path",":","The","path","to","the","relations","file",",","which","can","either","be","a","local","or","disrtibuted","file","system","(","such","as","HDFS",")","path",".",":","param","sc",":","An","instance","of","SparkContext",".","If","specified",",","return","RDD","of","Relation",".","Default","is","None","and","in","this","case","return","list","of","Relation",".",":","param","min_partitions",":","Int",".","A","suggestion","value","of","the","minimal","partition","number","for","input","texts",".","Only","need","to","specify","this","when","sc","is","not","None",".","Default","is","1","."]
code: def read(path, sc=None, min_partitions=1, bigdl_type="float"):
      """
      Read relations from csv or txt file.
      Each record is supposed to contain the following three fields in order:
      id1(string), id2(string) and label(int).
  
      For csv file, it should be without header.
      For txt file, each line should contain one record with fields separated by comma.
  
      :param path: The path to the relations file, which can either be a local or disrtibuted file
                   system (such as HDFS) path.
      :param sc: An instance of SparkContext.
                 If specified, return RDD of Relation.
                 Default is None and in this case return list of Relation.
      :param min_partitions: Int. A suggestion value of the minimal partition number for input
                             texts. Only need to specify this when sc is not None. Default is 1.
      """
      if sc:
          jvalue = callZooFunc(
              bigdl_type, "readRelations", path, sc, min_partitions
          )
          res = jvalue.map(
              lambda x: Relation(str(x[0]), str(x[1]), int(x[2]))
          )
      else:
          jvalue = callZooFunc(bigdl_type, "readRelations", path)
          res = [
              Relation(str(x[0]), str(x[1]), int(x[2])) for x in jvalue
          ]
      return res
  
imports: from bigdl.dllib.utils.common import *
  from bigdl.dllib.utils.file_utils import callZooFunc
  from bigdl.dllib.feature.dataset.dataset import DataSet
  from pyspark.serializers import CloudPickleSerializer
  import sys
  import math
  import warnings
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 1 for calling the Relations obj's underlying member method code with example usage: obj.read(path, sc, min_partitions, bigdl_type) and returns: res