def initialize_dictionaries(self, e_set, max_feats2 = <NUM_LIT:200>):
if(hasattr(e_set, '<STR_LIT>')):<EOL><INDENT>if(e_set._type == "<STR_LIT:train>"):<EOL><INDENT>nvocab = util_functions.get_vocab(e_set._text, e_set._score, max_feats2 = max_feats2)<EOL>svocab = util_functions.get_vocab(e_set._clean_stem_text, e_set._score, max_feats2 = max_feats2)<EOL>self._normal_dict = CountVectorizer(ngram_range=(<NUM_LIT:1>,<NUM_LIT:2>), vocabulary=nvocab)<EOL>self._stem_dict = CountVectorizer(ngram_range=(<NUM_LIT:1>,<NUM_LIT:2>), vocabulary=svocab)<EOL>self.dict_initialized = True<EOL>self._mean_spelling_errors=sum(e_set._spelling_errors)/float(len(e_set._spelling_errors))<EOL>self._spell_errors_per_character=sum(e_set._spelling_errors)/float(sum([len(t) for t in e_set._text]))<EOL>good_pos_tags,bad_pos_positions=self._get_grammar_errors(e_set._pos,e_set._text,e_set._tokens)<EOL>self._grammar_errors_per_character=(sum(good_pos_tags)/float(sum([len(t) for t in e_set._text])))<EOL>bag_feats=self.gen_bag_feats(e_set)<EOL>f_row_sum=numpy.sum(bag_feats[:,:])<EOL>self._mean_f_prop=f_row_sum/float(sum([len(t) for t in e_set._text]))<EOL>ret = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>raise util_functions.InputError(e_set, "<STR_LIT>")<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise util_functions.InputError(e_set, "<STR_LIT>")<EOL><DEDENT>return ret<EOL>
Initializes dictionaries from an essay set object
Dictionaries must be initialized prior to using this to extract features
e_set is an input essay set
returns a confirmation of initialization