def svm_predict_3_points(rows): data = preprocessing.generate_BOW(rows, svm_3_dict) y_predict = svm_3_clf.predict(data) return [each + 1 for each in list(y_predict)]
def naive_bayes_predict_3_points(rows): data = preprocessing.generate_BOW(rows, naive_3_dict) y_predict = naive_3_clf.predict(data) return [each + 1 for each in list(y_predict)]
def svm_predict_2_points(rows): data = preprocessing.generate_BOW(rows, svm_2_dict) y_predict = svm_2_clf.predict(data) return [each + 1 if each == -1 else each for each in list(y_predict)]
def predict(self, txt): txt = preprocessing.generate_BOW(txt, self.dic, n_gram=self.n_gram, use_bern=self.use_bern) y_pred = self.clf.predict(txt) return y_pred