script for extracting training data for target id'ing