def post_process_states(input_t_str, states, pos_tag_sentence):
    """
    Post-processes the states (either lstm cell states or probabilities of
    a byte belonging to a POS tag) of input_t_str.
    If a unicode char of input_t_str has more than one byte in utf-8, take the
    state associated with the last byte.

    Args:
        input_t_str (str): text to parse.
        states (list): list of neuron activations for each byte in
                       input_t_str, or probabilities of each byte belonging
                       to a POS tag.
        pos_tag_sentence (list): pos tag for each byte of input_t_str.

    Returns:
        states_tmp (list): list of lstm activations / probabilities for each
                           byte.
        pos_tags (list): list of pos tags for each byte.
    """
    states_tmp = []
    pos_tags = []
    i = 0
    for ch in input_t_str:
        n_bytes = len(ch.encode('utf-8'))
        if n_bytes == 1:
            states_tmp.append(states[i])
            pos_tags.append(pos_tag_sentence[i])
            i += 1
        else:
            states_tmp.append(states[i + n_bytes - 1])
            pos_tags.append(pos_tag_sentence[i + n_bytes - 1])
            i += n_bytes
    return states_tmp, pos_tags