unlike Language model we use only last output and put it into softmax to predict what kind of language is it we first extract ascii code and then we feed them to embedding matrix. def str2ascii_arr(msg): arr = [ord(c) for c in msg] return arr, len(arr) # pad sequences and sort the tensor def pad_sequences(vectorized_seqs, seq_lengths): seq_tensor = torch.zeros((len(vectorized_seqs), seq_lengths...