(mentions, id_attribute)
return graphs
Construct a set of entity graphs from mentions.

        In particular, build a complete graph for every subset of mentions that
        have the same id_attribute.

        Args:
            mentions (list(Mention)): A list of mentions.
            id_attribute (str): The mention attribute which should be used to
                determine coreference. Possible values are "annotated_set_id"
                and "set_id".

        Returns:
            list(EntityGraph): A list of entity graphs. Two mentions are in one
            entity graph if and only if they have the same id_attribute.
Construct a set of entity graphs from mentions.
Construct a set of entity graphs from mentions .
def from_mentions(mentions, id_attribute):
        """ Construct a set of entity graphs from mentions.

        In particular, build a complete graph for every subset of mentions that
        have the same id_attribute.

        Args:
            mentions (list(Mention)): A list of mentions.
            id_attribute (str): The mention attribute which should be used to
                determine coreference. Possible values are "annotated_set_id"
                and "set_id".

        Returns:
            list(EntityGraph): A list of entity graphs. Two mentions are in one
            entity graph if and only if they have the same id_attribute.
        """
        id_to_mentions = defaultdict(list)

        for mention in mentions:
            if mention.attributes[id_attribute] is None:
                continue
            else:
                id_to_mentions[
                    mention.attributes[id_attribute]].append(mention)

        graphs = [EntityGraph.__create_complete(sorted(mention_list))
                      for mention_list in id_to_mentions.values()
                      if len(mention_list) > 1]

        return graphs
def from_mentions ( mentions , id_attribute ) : id_to_mentions = defaultdict ( list ) for mention in mentions : if mention . attributes [ id_attribute ] is None : continue else : id_to_mentions [ mention . attributes [ id_attribute ] ] . append ( mention ) graphs = [ EntityGraph . __create_complete ( sorted ( mention_list ) ) for mention_list in id_to_mentions . values ( ) if len ( mention_list ) > 1 ] return graphs