I have a sequence to sequence learning model which works fine and able to predict some outputs. The problem is I have no idea how to convert the output back to text sequence
You can make the dictionary that map index back to character.
index_word = {v: k for k, v in tk.word_index.items()} # map back
seqs = tk.texts_to_sequences(txt1)
words = []
for seq in seqs:
if len(seq):
words.append(index_word.get(seq[0]))
else:
words.append(' ')
print(''.join(words)) # output
>>> 'what makes this problem difficult is that the sequences can vary in length
>>> be comprised of a very large vocabulary of input symbols and may require the model
>>> to learn the long term context or dependencies between symbols in the input sequence '
However, in the question, you're trying to use sequence of characters to predict output of 10 classes which is not the sequence to sequence model. In this case, you cannot just turn prediction (or pred.argmax(axis=1)) back to sequence of characters.