Пример #1
0
 def __init__(self, mode='train'):
     ClassicalFeature.__init__(self, mode)
     self.extract_stage = [self._extract]
     # uni_words = ['what', 'whi', 'which', 'how', 'where', 'when', 'if', 'can', 'should']
     # do_words = ['doe', 'do', 'did']
     # be_words = ['is', 'are']
     # will_words = ['will', 'would']
     # self.words = uni_words + do_words + be_words + will_words
     self.words = ['what', 'whi', 'which', 'how', 'where', 'when']
     self.columns = [
         '_'.join(word)
         for word in combinations_with_replacement(self.words, 2)
     ]
Пример #2
0
 def __init__(self, gtype, mode='train'):
     ClassicalFeature.__init__(self, mode)
     if gtype == 'concurrence':
         self.seq2id, self.graph = UnDirectGraph.load()
     else:
         self.seq2id, self.graph = UnDirectWeightGraph.load()
Пример #3
0
 def __init__(self, mode='train'):
     ClassicalFeature.__init__(self, mode)
     self.idf = TFIDF.load()
     self.extract_stage = [self._extract]
     self.idf_vocab = self.idf.get_feature_names()
Пример #4
0
 def __init__(self, mode='train'):
     ClassicalFeature.__init__(self, mode)
     self.idf = TFIDF.load()
     self.extract_stage = [self._extract]
Пример #5
0
 def __init__(self, mode='train'):
     ClassicalFeature.__init__(self, mode)
     self.extract_stage = [self._extract]
     self.model = W2V.load()
Пример #6
0
 def __init__(self, mode='train'):
     ClassicalFeature.__init__(self, mode)
     self.extract_stage = [self._init_prob, self._extract]
     self.filter_words = list(Punctuations.PUNCTUATIONS) + list(
         StopWords.StopWordsEN)
Пример #7
0
 def __init__(self, mode='train'):
     ClassicalFeature.__init__(self, mode)
     self.extract_stage = [self.init_idf, self._extract]