Feature vectors for multiclass perceptron
I approached this problem by utilizing ID for each unigram that occurs in the training set; specifically, each instance within the training set. 
As such, first I create a distinct vocab dictionary by iterating through each document in, giving incremental id to each term that is newly seen. When performing perceptron, I iterate through the vocab ids with their count in the document and multiply them with the associated entry in perceptron weight matrices. In this sense, I would not need to do dot product, ignoring those sparse entries (0 * 0).
I'm trying to implement Multiclass Perceptron in python. I have fully understood the concept of perceptron algorithm when it comes to multiclassification, but still get puzzled by the feature vectors that we should provide out of training data. 
The problem is simply a text (document) classification problem. I'm trying to use unigram term frequencies as features for the perceptron in text preprocessing stage. When I'm constructing features for each document based on term (i.e., unigram) frequencies in each training document, the constructed feature happens to be very sparse (term frequencies for each token that occurs in the document, and 0 for those that do not occur). 
My question is about an alternative schema for this. Is there a better solution for constructing feature vectors? 
Thanks!