Download scripts/process_all.sh from EuropeanParliament/EuroVoc: direct link, hf CLI and curl.
- Browser
- Download file 744 Bytes
-
https://huggingface.co/datasets/EuropeanParliament/EuroVoc/resolve/main/scripts/process_all.sh
- Command line
-
hf download hf://datasets/EuropeanParliament/EuroVoc/scripts/process_all.sh
-
curl -L -o process_all.sh https://huggingface.co/datasets/EuropeanParliament/EuroVoc/resolve/main/scripts/process_all.sh
744 Bytes
| # Generate EuroVoc dictionary | |
| python get_eurovoc_dict.py | |
| # Create output directory if it doesn't exist | |
| mkdir -p outs_id/ | |
| # Process .jsonl.gz files in outs_id/ | |
| for input_file in outs/*.jsonl.gz; do | |
| filename=$(basename "$input_file" .gz) | |
| temp_file="outs_id_correct/${filename}.tmp" | |
| output_file="outs_id_correct/${filename}.gz" | |
| echo "Processing $filename..." | |
| gunzip -c "$input_file" | python add_id.py /dev/stdin "$temp_file" | |
| if [ -s "$temp_file" ]; then | |
| gzip "$temp_file" -c > "$output_file" | |
| rm -f "$temp_file" | |
| echo "✓ Saved to $output_file" | |
| else | |
| echo "✗ Error: temp file is empty" | |
| rm -f "$temp_file" | |
| fi | |
| done | |
| echo "All files processed and compressed!" |