easyiec.problems.TextDesign#

class easyiec.problems.TextDesign(topic='the open day of a university of technology', keywords=('future', 'together', 'discover'), client=None, max_words=8, language='English')[source]#

Bases: Problem

Short texts (slogans, taglines) for a given topic.

Parameters:
topicstr
keywordssequence of str

Words the default (simulated-user) utility rewards.

clientLLMClient, optional

Use LLMText variation; otherwise TemplateText.

max_wordsint
languagestr
describe(x)[source]#

Text description of a candidate (for text-only judges).

features(x)[source]#

Phenotype features in psychological space (default: image features).

modality = 'text'#

modality presented to judges: “image” or “text”

random(rng, n=None)[source]#

Random genome(s) from the search space.

repair(x)[source]#

Make a genome feasible (default: clip to the box).

utility(x, target=None)[source]#

Default hidden utility in [0, 1] (ground truth of benchmarks).

With a target genome it is a Gaussian similarity of standardized phenotype features; subclasses with explicit objectives override it.

Examples using easyiec.problems.TextDesign#

Beyond images: melodies and slogans

Beyond images: melodies and slogans