def create_entity_pairs(doc):
    """ Create pairs of entity indices """
    entity_pairs = []

    for i1, _ in enumerate(doc.entities):
        for i2, _ in enumerate(doc.entities):
            if i1 != i2:
                pair = (i1, i2)
                entity_pairs.append(pair)
    return entity_pairs