It’s a shame I did not reuse my own code since that post… So right now I don’t have it in mind anymore, I had to read it probably as you did to understand what I might have done (plus I am not testing it as I am writing). I would advise you to run the code line by line, and also run the lines within that function forward_one_word and see what is inside char_lvl[-1].view(1,1,-1) in comparison to char_lvl…




My guess (again sorry I cannot verify the code right now) is that I do take the last word representation at the character level, since I think the input is the list of char in the list of words of a given sentence. So basically it’s just a way to merge representation of one word (woird embedding + its char level representation) together…




Do you mean Part of speech tag (the labels in this task) by affix? But yes you train the model with words as input and target POS tag as output, the training procedure is also in the code I posted. I wrap inputs and outputs in corresponding sequences with prepare_sequence:
sentence_in, chars_in = prepare_both_sequences(sentence, word_to_ix, 
targets = prepare_sequence(tags, tag_to_ix)