if is_training_mode:
for token in sentence:
if self.stemmer.stem(token.word) not in self.stop_words and not token.features["is_punct"]:
feature_name = "4_bow_stem_" + self.stemmer.stem(token.word) + "_[0]"
self.add_to_feature_set(feature_set, is_training_mode, edge, feature_name)
After Change
if is_training_mode:
for token in sentence:
if self.stemmer.stem(token.word) not in self.stop_words and not token.features["is_punct"]:
feature_name = self.gen_prefix_feat_name("prefix_bow_stem", self.stemmer.stem(token.word))
self.add_to_feature_set(feature_set, is_training_mode, edge, feature_name)