{"data":{"kind":"file","path":"README.md","version_id":"wkbbxrexrdg0uqq3j4kcq2ra","entry":{"name":"README.md","path":"README.md","is_directory":false,"size":2220,"modified_at":"2026-03-22T14:18:51.263000","content_hash":"c7e4b60d079f4b361c175a3e657da6462a3812541819295e7e8c820886cfff2d"},"entries":[],"content":"# spam-detection-rl-environment\n\n### Overview\n- **Environment ID**: `spam-detection-rl-environment`\n- **Short description**: A reinforcement learning environment for training models to classify text messages as spam or not spam\n- **Tags**: spam-detection, text-classification, train, eval\n\n### Datasets\n- **Primary dataset(s)**: Deysi/spam-detection-dataset - A dataset containing text messages labeled as spam or not_spam\n- **Source links**: https://huggingface.co/datasets/Deysi/spam-detection-dataset\n- **Split sizes**: Train and test splits (sizes depend on dataset version)\n\n### Task\n- **Type**: single-turn\n- **Output format expectations**: XML tags with answer field containing either \"spam\" or \"not_spam\"\n- **Rubric overview**: \n  - Exact match reward (80% weight): Checks if the predicted label matches the ground truth\n  - Format reward (20% weight): Validates that the response follows the required XML format\n\n### Quickstart\nRun an evaluation with default settings:\n\n```bash\nprime eval run spam-detection-rl-environment\n```\n\nConfigure model and sampling:\n\n```bash\nprime eval run spam-detection-rl-environment \\\n  -m gpt-4.1-mini \\\n  -n 20 -r 3 -t 1024 -T 0.7 \\\n  -a '{\"key\": \"value\"}'  # env-specific args as JSON\n```\n\nNotes:\n- Use `-a` / `--env-args` to pass environment-specific configuration as a JSON object.\n\n### Environment Arguments\nThis environment uses the standard Verifiers framework arguments. Custom arguments can be passed via the `load_environment(**kwargs)` function.\n\n| Arg | Type | Default | Description |\n| --- | ---- | ------- | ----------- |\n| `max_examples` | int | `-1` | Limit on dataset size (use -1 for all) |\n\n### Metrics\nThe rubric emits the following metrics:\n\n| Metric | Meaning |\n| ------ | ------- |\n| `reward` | Main scalar reward (weighted sum: 80% exact match + 20% format compliance) |\n| `exact_match` | Binary indicator (1.0 or 0.0) if predicted label exactly matches ground truth |\n| `format_valid` | Binary indicator (1.0 or 0.0) if response follows required XML format with answer tags |\n\n### Expected Output Format\nModels should respond with their classification wrapped in XML answer tags:\n\n```xml\n<answer>\nspam\n</answer>\n```\n\nor\n\n```xml\n<answer>\nnot_spam\n</answer>\n","encoding":"utf-8","truncated":false,"total_bytes":2220},"status":null}