You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor prompt-dataset config matching and add emotion benchmark
Updated the evaluator to automatically match prompt files with their corresponding dataset configuration using a naming convention. Added emotion classification benchmark files (`emotion_prompt.txt`, `emotion_prompt_dataset.yaml`) and a wrapper script (`run_evolution.sh`) for easier execution. Deprecated and removed old example files, and improved documentation in the README to reflect the new workflow and dataset handling.
Copy file name to clipboardExpand all lines: examples/llm_prompt_optimization/README.md
+44-22Lines changed: 44 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ OpenEvolve automatically:
10
10
- Uses cascading evaluation for efficiency
11
11
- Finds optimal prompts for your specific task and model
12
12
13
-
The system uses a clean YAML format for configuration, making it easy to set up prompt optimization for any dataset.
13
+
**Key Feature**: The evaluator automatically matches prompt files with dataset configurations using a naming convention (`xxx_prompt.txt` → `xxx_prompt_dataset.yaml`), making it easy to manage multiple benchmark tasks.
14
14
15
15
## 🚀 Quick Start
16
16
@@ -36,52 +36,74 @@ llm:
36
36
37
37
### 3. Set Up Your Dataset and Prompt
38
38
39
-
Configure your dataset in `dataset.yaml`:
39
+
This example uses a naming convention to match prompts with their dataset configurations:
40
+
- For a prompt file `xxx_prompt.txt`, create a matching `xxx_prompt_dataset.yaml`
41
+
- For example: `emotion_prompt.txt`uses `emotion_prompt_dataset.yaml`
42
+
43
+
Create your dataset configuration file (e.g., `emotion_prompt_dataset.yaml`):
40
44
41
45
```yaml
42
46
# HuggingFace dataset configuration
43
-
dataset_name: "stanfordnlp/imdb" # Any HuggingFace dataset
47
+
dataset_name: "dair-ai/emotion" # Any HuggingFace dataset
44
48
input_field: "text" # Field containing input data
45
49
target_field: "label" # Field containing ground truth
46
50
split: "test" # Dataset split to use
47
51
48
52
# Evaluation samples
49
-
max_samples: 50 # Number of samples to evaluate
53
+
max_samples: 200 # Number of samples to evaluate
50
54
```
51
55
52
-
Create your initial prompt in `initial_prompt.txt`:
56
+
Create your initial prompt file (e.g., `emotion_prompt.txt`):
53
57
54
58
```
55
-
Your initial prompt here with {input_text} as placeholder
59
+
Classify the emotion expressed in the following text.
60
+
61
+
Text: "{input_text}"
62
+
63
+
Emotion (0-5):
56
64
```
57
65
58
66
### 4. Run OpenEvolve
59
67
68
+
Use the provided `run_evolution.sh` script to ensure the correct dataset is used:
0 commit comments