def get_sample(sample_ix, encoding_to_chars): txt = ''.join(encoding_to_chars[ix] for ix in sample_ix) txt = txt[0].upper() + txt[1:] return txt