Add Ethical Red Team dataset loader#1519
Conversation
|
@microsoft-github-policy-service agree |
|
You will need to rerun notebook 1 from the datasets docs to show the dataset in the list there. |
| def __init__( | ||
| self, | ||
| *, | ||
| source: str = "srushtisingh/Ethical_redteam", |
There was a problem hiding this comment.
Probably needn't be configurable
| "Ethical Red Team dataset from Hugging Face. " | ||
| "Contains prompts intended for red-teaming and safety testing of language models." | ||
| ), | ||
| source=f"https://huggingface.co/datasets/{self.source}", |
|
|
||
| logger.info(f"Successfully loaded {len(seed_prompts)} prompts from Ethical Red Team dataset") | ||
|
|
||
| return SeedDataset(seeds=seed_prompts, dataset_name=self.dataset_name) |
There was a problem hiding this comment.
A maintainer should run the integration test and make sure it works and looks as expected
| SeedPrompt( | ||
| value=item["prompt"], | ||
| data_type="text", | ||
| dataset_name=self.dataset_name, |
There was a problem hiding this comment.
Sadly the dataset is not annotated with harm categories... That would be really useful.
|
The reason for creating this dataset is a bit unclear since the HF dataset has no documentation. It might be copied from other sources, hard to say. Probably a class project? In any case, the biggest drawback for us is the lack of harm category annotations. I'll close this for now but that has nothing to do with your contribution @96528025 . Please feel free to contribute other things in the future, and if you're not sure just open an issue. |
Summary
srushtisingh/Ethical_redteamTesting
.venv/bin/python -m pytest tests/unit/datasets/test_ethical_redteam_dataset.py -q.venv/bin/python -m pytest tests/unit/datasets/test_harmful_qa_dataset.py tests/unit/datasets/test_toxic_chat_dataset.py -q.venv/bin/python -m ruff check pyrit/datasets/seed_datasets/remote/ethical_redteam_dataset.py tests/unit/datasets/test_ethical_redteam_dataset.py pyrit/datasets/seed_datasets/remote/__init__.py