Heyjab's picture VINAY-UMRETHE's picture
Duplicate from heretic-org/Multilingual-Harmless-Harmful
67520a7
|
Raw History Blame Contribute Delete
2.23 kB

Contributing

You can use Hugging Face Hub for Contributing via pull requests. Follow the steps as described below.

Add a new language

You just need two .txt files. That's it.

First, you need to translate the original English Harmful and Harmless prompt pairs into the language you want.

1. Add the translated prompts

Create a new folder under data/ named after the language (lowercase, e.g. data/german/). Inside it add two files named {code}_harmful.txt and {code}_harmless.txt where {code} is the ISO 639-1 two digit code (e.g. data/german/de_harmful.txt and de_harmless.txt). Languages are auto-detected from data/ folder names. One prompt per line, aligned with data/english/en_harmful.txt and en_harmless.txt, line 1 pairs with line 1, and so on.

2. Convert the .txt files

pip install datasets huggingface_hub
python scripts/convert.py

This reads everything in data/ and creates content/{lang}/text/, json/, csv/ automatically. The script will auto-detect languages from data/ and ask you to confirm each one, just hit y for the ones you want.

3. Open a pull request

You should only add one language per PR.

You need a Hugging Face account and a write token.

python scripts/upload_to_hub.py --create-pr

Use a clear title like Add German (de) and mention if you actually speak / understand the language or how you checked a few samples. This is not a strict requirement, but being able to understand the language you want to Add into the dataset is always better and more likely to get my attention.

Notes

Every PR needs manual review and nothing merges on its own. Spam or low-effort PRs will be closed, see (Hub moderation docs). One language per PR is expected and make sure the line counts match (should be 416 for each split: harmful and harmless).