#NEWLINE# def __init__( self , bigram_path , question_db ) : #NEWLINE# #INDENT# self . _qdb = question_db #NEWLINE# self . _bigrams = pickle . load ( open ( question_db , 'rb' ) ) #NEWLINE# self . _majority = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . _frequencies = defaultdict ( dict ) #NEWLINE# self . _cache = None #NEWLINE# self . _fv = None #NEWLINE# self . _pd = None #NEWLINE# self . _classifiers = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . _name = 'classifier' #NEWLINE# self . add_classifier ( 'data/classifier/category.pkl' , 'category' ) #NEWLINE# self . add_classifier ( 'data/classifier/ans_type.pkl' , 'ans_type' ) #NEWLINE# self . add_classifier ( 'data/classifier/gender.pkl' , 'gender' ) #NEWLINE# self . cache_majorities ( 'category' ) #NEWLINE# self . cache_majorities ( 'ans_type' ) #NEWLINE# self . cache_majorities ( 'gender' )