python code for pre-processing forum data