refine preprocessing.py and change result data in rails server