| # 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!" |