code: def compile_entity_feature_generator():
      
  
      BASIC_ATTRIBS_REL = ["lemma", "dep_label"]
  
      m = Mention(0)
  
      # Basic relation feature templates
      temps = [
          [Indicator(m, a) for a in BASIC_ATTRIBS_REL],
          Indicator(m, "dep_label,lemma"),
          # The *first element on the* path to the root: ngram lemmas along it
          Ngrams(Parents(m, 3), "lemma", (1, 3)),
          Ngrams(Children(m), "lemma", (1, 3)),
          # The siblings of the mention
          [LeftNgrams(LeftSiblings(m), a) for a in BASIC_ATTRIBS_REL],
          [RightNgrams(RightSiblings(m), a) for a in BASIC_ATTRIBS_REL],
      ]
  
      # return generator function
      return Compile(temps).apply_mention
docs: Given optional arguments, returns a generator function which accepts an xml
      root and a list of indexes for a mention, and will generate relation
      features for this entity.