def _featurize(self, w1, w2): s1 = Wordnet.get_significant_synsets(w1) s2 = Wordnet.get_significant_synsets(w2) yield 'wordnet_hyp', float(Wordnet.is_hypernym(s1, s2)) yield 'wordnet_2-hyp', float(Wordnet.is_two_link_hypernym(s1, s2)) yield 'wordnet_deriv_rel', float( Wordnet.is_derivationally_related(s1, s2)) yield 'wordnet_in_glosses', float(Wordnet.in_glosses(w1, w2, s1, s2))