def gen_one_pair_data(self, name, set1,
                        set2):
    """Generate one data point for set intersection.

    Args:
      name: 'intersection' or 'union'
      set1: a list of entities in set 1
      set2: a list of entities in set 2

    Returns:
      k hot vectors of set1, set2 and labels
    """
    assert len(set1 & set2) >= 1
    candidate_set1 = np.zeros(self.num_entities)
    candidate_set1[[self.entity2id[e] for e in set1]] = 1.0
    candidate_set2 = np.zeros(self.num_entities)
    candidate_set2[[self.entity2id[e] for e in set2]] = 1.0

    if name == 'union':
      return (candidate_set1, candidate_set2,
              np.maximum(candidate_set1, candidate_set2))
    elif name == 'intersection':
      return (candidate_set1, candidate_set2,
              np.minimum(candidate_set1, candidate_set2))
    else:
      raise ValueError('name not recognised: %s' % name)
Generate one data point for set intersection.

    Args:
      name: 'intersection' or 'union'
      set1: a list of entities in set 1
      set2: a list of entities in set 2

    Returns:
      k hot vectors of set1, set2 and labels
    
language/emql/data_loader.py