Update predictive_text.py

Improved words to numbers part and fixed array generation at the end.