(predict_seqs, blank_id, unique=True)
return decode_seq
decod using simple greedy search
        :param predict_seqs: ([B, T, C], type=float) the output of CTC-based asr model.
        :param blank_id: (type=int) the index of blank symbol
        :param unique: (type=boolean) if merge consecutive repeated classes in output
        :return: ([B, T]) the result of greedy decode
decod using simple greedy search
        :param predict_seqs: ([B, T, C], type=float) the output of CTC-based asr model.
        :param blank_id: (type=int) the index of blank symbol
        :param unique: (type=boolean) if merge consecutive repeated classes in output
        :return: ([B, T]) the result of greedy decode
decod using simple greedy search : param predict_seqs : ( [ B T C ] type = float ) the output of CTC - based asr model . : param blank_id : ( type = int ) the index of blank symbol : param unique : ( type = boolean ) if merge consecutive repeated classes in output : return : ( [ B T ] ) the result of greedy decode
def ctc_greedy_decode(predict_seqs, blank_id, unique=True):
  """
        decod using simple greedy search
        :param predict_seqs: ([B, T, C], type=float) the output of CTC-based asr model.
        :param blank_id: (type=int) the index of blank symbol
        :param unique: (type=boolean) if merge consecutive repeated classes in output
        :return: ([B, T]) the result of greedy decode
        """
  decode_seq = []

  for predict_seq in predict_seqs:
    cur_token_list = [np.argmax(prob_list) for prob_list in predict_seq]

    cur_decode_list = []
    if unique:
      temp = groupby(cur_token_list)
      cur_decode_list = [key for key, group in temp if key != blank_id]
    else:
      cur_decode_list = [
          token_id for token_id in cur_token_list if token_id != blank_id
      ]
    decode_seq.append(cur_decode_list)

  return decode_seq
def ctc_greedy_decode ( predict_seqs , blank_id , unique = True ) : decode_seq = [ ] for predict_seq in predict_seqs : cur_token_list = [ np . argmax ( prob_list ) for prob_list in predict_seq ] cur_decode_list = [ ] if unique : temp = groupby ( cur_token_list ) cur_decode_list = [ key for key , group in temp if key != blank_id ] else : cur_decode_list = [ token_id for token_id in cur_token_list if token_id != blank_id ] decode_seq . append ( cur_decode_list ) return decode_seq