You would need to convert the target to a tensor e.g. via a dictionary. The linked Seq2Seq tutorial gives you an example how to map from one language to another and you could adapt it for your use case.