code for generating and recording sentence+text features