(paths, column_num)
return tuple(ds_list)
Load raw data for text task.
Load raw data for text task.
Load raw data for text task .
def load_textline_dataset(paths, column_num):
  """Load raw data for text task."""
  ds = tf.data.TextLineDataset(paths)
  ds = ds.map(lambda x: tf.squeeze(
      tf.strings.split(x, sep="\t", result_type="RaggedTensor"), axis=0))
  ds = ds.filter(lambda line: tf.equal(tf.size(line), column_num))
  ds_list = []
  for i in range(column_num):
    ds_list.append(ds.map(lambda x: x[i]))

  return tuple(ds_list)
def load_textline_dataset ( paths , column_num ) : ds = tf . data . TextLineDataset ( paths ) ds = ds . map ( lambda x : tf . squeeze ( tf . strings . split ( x , sep = "\t" , result_type = "RaggedTensor" ) , axis = 0 ) ) ds = ds . filter ( lambda line : tf . equal ( tf . size ( line ) , column_num ) ) ds_list = [ ] for i in range ( column_num ) : ds_list . append ( ds . map ( lambda x : x [ i ] ) ) return tuple ( ds_list )