コード例 #1
0
def load_stat21x_trans(filename, label_type='int'):
  with open(filename) as f:
    for line in f:
      if "++++++++++" in line or "==========" in line:
        continue
      items = line.strip().split('\t')
      if label_type == 'int':
        yield (my_util.str_to_sparse(items[0]), int(items[1]))
      elif label_type == 'strings':
        yield (my_util.str_to_sparse(items[0]), items[1].split(' '))
コード例 #2
0
def load_stat21x_tx(filename):
  with open(filename) as f:
    for line in f:
      items = line.strip().split('\t')
      yield (my_util.str_to_sparse(items[0]), items[1])
コード例 #3
0
def load_stat21x_slides(filename):
  with open(filename) as f:
    for line in f:
      items = line.strip().split('_')
      yield my_util.str_to_sparse(items[1])