Text this: Faithful inversion of generative models for effective amortized inference