def get_features(self, node, parent):
feats = {}
for name, func in self.features.iteritems():
val = func(node, parent)
for subname, subval in val.iteritems():
feats[name + "_" + subname] = subval
After Change
def get_features(self, node, parent):
feats_hier = {}
for name, func in self.features.iteritems():
feats_hier[name] = func(node, parent)
feats = {}
for name, val in feats_hier.iteritems():