preprocessing script for raw data from Lex app