for , in taggedpn , sent_pos_type none if startswith("nn")sent_pos_type "nnouns + elif startswith("jj")sent_pos_type "aadjectives + elif startswith("vb")sent_pos_type "vverbs + elif startswith("rb")sent_pos_type "radverbs + if sent_pos_type is not nonesent_word "% /% "%(sent_pos_typewif sent_word in sent_word_netp, sent_word_net[sent_wordpos_vals append(pneg_vals append(nl len(sentavg_pos_val np mean(pos_valsavg_neg_val np mean(neg_valsreturn [ -avg_pos_val-avg_neg_valavg_pos_valavg_neg_valnouns/ladjectives/lverbs/ladverbs/ldef transform(selfdocuments)obj_valpos_valneg_valnounsadjectivesverbsadverbs np array([self _get_sentiments(dfor in documents] allcaps [exclamation [question [hashtag [mentioning [