def _cut_eos(predict_batch, eos_id):
  """cut the eos in predict sentences"""
  pred = []
  for s in predict_batch:
    s_ = []
    for w in s:
      if(w == eos_id): break
      s_.append(w)
    pred.append(s_)
  return pred