def check_cvt_entity(self):
    """This function check if an entity is cvt.

    We simply assume that tail entities of a ent2cvt relation is a cvt entity.
    And head entities of a cvt2ent relation is a cvt entity.

    Returns:
      A zero-one vector indicating if an entity is cvt
    """
    cvt_entities = set()
    ent_entities = set()
    for subj, facts in tqdm(self.kb.items()):
      for rel, objs in facts.items():
        if rel in self.ent2ent_relations:
          ent_entities.add(subj)
          ent_entities.update(objs)
          if subj in cvt_entities or (set(objs) & cvt_entities):
            pass
        elif rel in self.ent2cvt_relations:
          ent_entities.add(subj)
          cvt_entities.update(objs)
          if subj in cvt_entities or (set(objs) & ent_entities):
            pass
        elif rel in self.cvt2ent_relations:
          cvt_entities.add(subj)
          ent_entities.update(objs)
          if subj in ent_entities or (set(objs) & cvt_entities):
            pass

    tf.logging.info('cvt_entities: %d ent_entities: %d' %
                    (len(cvt_entities), len(ent_entities)))

    all_entity_is_cvt = np.zeros(len(self.id2entity), dtype=np.int32)
    for entity in cvt_entities:
      all_entity_is_cvt[self.entity2id[entity]] = 1
    return all_entity_is_cvt
This function check if an entity is cvt.

    We simply assume that tail entities of a ent2cvt relation is a cvt entity.
    And head entities of a cvt2ent relation is a cvt entity.

    Returns:
      A zero-one vector indicating if an entity is cvt
    
language/emql/data_loader.py