def __init__(self, model='svm', features='bm25,', comment_features='bm25,', stop=True, vector='word2vec', path=FEATURES_PATH, alpha=0.1, sigma=0.9, gridsearch='random'): Quora.__init__(self, stop=stop, vector=vector) self.path = path self.features = features.split(',') self.comment_features = comment_features.split(',') self.gridsearch = gridsearch self.svm = Model() self.model = model self.bm25 = QuoraBM25(stop=stop) if 'bm25' in self.features+self.comment_features else None self.cosine = QuoraCosine(stop=stop) if 'cosine' in self.features+self.comment_features else None self.softcosine = QuoraSoftCosine(stop=stop, vector=vector) if 'softcosine' in self.features+self.comment_features else None self.translation = QuoraTranslations(alpha=alpha, sigma=sigma, stop=stop, vector=self.vector) if 'translation' in self.features+self.comment_features else None self.train()
def __init__(self, alpha, sigma, stop=True, vector='word2vec'): Quora.__init__(self, stop=stop, vector=vector) self.alpha = alpha self.sigma = sigma self.train()
def __init__(self, stop=True, vector='word2vec'): Quora.__init__(self, stop=stop, vector=vector) self.train()
def __init__(self, stop=True): Quora.__init__(self, stop=stop) self.train()