Text this: Training Neural Networks with a Procedure Guided by BNF Grammars