our first estimator now we have everything in place to create our first vectorizer the most convenient way to do it is to inherit it from baseestimator it requires us to implement the following three methodsget_feature_names()this returns list of strings of the features that we will return in transform(fit(documenty=none)as we are not implementing classifierwe can ignore this one and simply return self transform(documents)this returns numpy array()containing an array of shape (len(documents)len(get_feature_names)this means that for every document in documentsit has to return value for every feature name in get_feature_names(let us now implement these methodssent_word_net load_sent_word_net(class linguisticvectorizer(baseestimator)def get_feature_names(self)return np array(['sent_neut''sent_pos''sent_neg''nouns''adjectives''verbs''adverbs''allcaps''exclamation''question''hashtag''mentioning']we don' fit here but need to return the reference so that it can be used like fit(dtransform(ddef fit(selfdocumentsy=none)return self def _get_sentiments(selfd)sent tuple( split()tagged nltk pos_tag(sentpos_vals [neg_vals [nouns adjectives verbs adverbs