Ejemplo n.º 1
0
    def anonymous_groundtruth_interest_group_id(self, definition):
        """Construct an identifier for an anonymous groundtruth interest group."""
        name = hash_key(definition)

        if self.dataset.groundtruths.hasInterestGroup(name):
            return name

        add_groundtruth_interest_group(self.__sql_database, name, definition)
        return name
Ejemplo n.º 2
0
    def anonymous_bucket_id(self, bucket):
        """Construct an identifier of an anonymous EvaluationBucket or SQL statement."""
        name = hash_key(bucket)

        if self.dataset.groundtruths.hasBucket(name):
            return name

        add_difficulty_bucket(self.__sql_database, name, bucket)
        return self.get_bucket_id(name)