Encode the context with the prefix of a word to be predicted.