'''To advanced users:'''
1. One important step in data preprocessing is to encode words (strings) into integers. The solution is to build a dictionary mapping words to their corresponding indices. For example, let's say "hello" is the 17th words in our dictionary and thus "hello" is encoded to 17. Our advanced dictionary is ordered by the words' frequency. Higher the frequency smaller the index, i.e. That is you should expect to see "the, " and "a, ..." these words in the smallest 10 with very small indices : 2, 3, 4, .... Please also notice that 0 and 1 these two indices are not assigned to any words intentionally. The advantage of doing this here is that you can specify easily ignore those very common and meaningless words , like "the", by simply say saying I only want to consider words with the index indices > 20 for example. And for any word Notice that it's possible to encounter words that is are not in our dictionary, code it with and we will alway assign them to index 1, so again you can easily . These words are safe to ignore itgiven that our dictionary is big enough.
2. Saving a pickle file is an very efficient way to retrieve the data so that you don't need to do preprocessing every time you want to run your classifier.