def __init__(self):
     parser = Parser()
     args = parser.get_section('FLAIR')
     self.corpus_path = args['flair_data_path']
     self.word_emb_path = args['flair_emb_path']
     self.model_path = args['flair_model_path']
     self.hidden_size = int(args['flair_num_hidden'])
     self.epochs = int(args['flair_epochs'])
Example #2
0
 def __init__(self):
     parser = Parser()
     args = parser.get_section('SVM')
     self.model_path = args['svm_model_path']
     self.pipeline = Pipeline([('vect',
                                CountVectorizer(tokenizer=self.do_nothing,
                                                preprocessor=None,
                                                lowercase=False)),
                               ('tfidf', TfidfTransformer()),
                               ('clf', LinearSVC(class_weight='balanced'))])