def sequences_add_start_id(sequences, start_id=0, remove_last=False):
 sequences_out = [[] for _ in range(len(sequences))]
 for i in range(len(sequences)):
  if remove_last:
   sequences_out[i] = ([start_id] + sequences[i][:(-1)])
  else:
   sequences_out[i] = ([start_id] + sequences[i])
 return sequences_out

def sequences_add_start_id ( sequences , start_id = 0 , remove_last = False ) : sequences_out = [ [ ] for _ in range ( len ( sequences ) ) ] for i in range ( len ( sequences ) ) : if remove_last : sequences_out [ i ] = ( [ start_id ] + sequences [ i ] [ : ( - 1 ) ] ) else : sequences_out [ i ] = ( [ start_id ] + sequences [ i ] ) return sequences_out
add special start token in the beginning of each sequence .