<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def count(self, X):
 """ Called from the fit method, this method gets all the words from the corpus and their corresponding frequency counts. Parameters X : ndarray or masked ndarray Pass in the matrix of vectorized documents, can be masked in order to sum the word frequencies for only a subset of documents. Returns ------- counts : array A vector containing the counts of all words in X (columns) """

        # Sum on axis 0 (by columns), each column is a word
        # Convert the matrix to an array
        # Squeeze to remove the 1 dimension objects (like ravel)
        return np.squeeze(np.asarray(X.sum(axis=0)))