A Transformer Model for Predicting Chemical Reaction Products from Generic Templates