File size: 3,376 Bytes
40bcd86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
# Example workflow for Swiss French dataset collection
# This script demonstrates the complete workflow from setup to export

echo "πŸ‡¨πŸ‡­ Swiss French Dataset Collection - Example Workflow"
echo "========================================================="
echo ""

# Step 1: Setup and create starter data
echo "πŸ“¦ Step 1: Setting up dataset structure and creating starter data..."
python3 swiss_french_dataset_builder.py --setup --create-all
echo "βœ… Setup complete!"
echo ""

# Step 2: Check initial statistics
echo "πŸ“Š Step 2: Checking initial dataset statistics..."
python3 swiss_french_dataset_builder.py --stats
echo ""

# Step 3: Generate synthetic data (example with small batch)
echo "πŸ€– Step 3: Generating synthetic translations..."
echo "   Note: This requires Apertus8B to be available"
echo ""

read -p "Do you want to generate synthetic data? (requires Apertus8B) [y/N]: " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
    # Generate 10 synthetic translations for Valais with validation
    python3 swiss_french_synthetic_generator.py \
        --dialect valais \
        --generate 10 \
        --validation

    echo ""
    echo "βœ… Synthetic data generated!"
    echo "πŸ“ Review the validation file in: datasets/swiss_french/Validation/"
    echo "   Edit the JSON file, set approved: true for good translations"
    echo "   Then import with: python3 swiss_french_synthetic_generator.py --import-validated <file>"
else
    echo "⏭️  Skipping synthetic generation"
fi
echo ""

# Step 4: Import example dictionary (if you have one)
echo "πŸ“š Step 4: Dictionary import example..."
echo "   If you have a CSV dictionary, import it with:"
echo "   python3 swiss_french_dataset_builder.py --dialect valais --import-csv my_dictionary.csv"
echo ""
echo "   Example CSV format:"
echo "   swiss_french,standard_french,dialect"
echo "   panosse,serpillière,valais"
echo "   Γ§a joue,Γ§a va,geneva"
echo ""

# Step 5: Create validation template
echo "βœ… Step 5: Creating validation template for human translations..."
python3 swiss_french_dataset_builder.py --dialect valais --validation-template
echo ""
echo "πŸ“ A CSV file has been created at: datasets/swiss_french/Validation/validation_template_valais.csv"
echo "   Open it in Excel/LibreOffice, fill in translations, then import:"
echo "   python3 swiss_french_dataset_builder.py --dialect valais --import-validated validation_template_valais.csv"
echo ""

# Step 6: Final statistics
echo "πŸ“Š Step 6: Final dataset statistics..."
python3 swiss_french_dataset_builder.py --stats
echo ""

# Step 7: Export instructions
echo "πŸ“¦ Step 7: When ready to export for training..."
echo "   Run: python3 swiss_french_dataset_builder.py --export"
echo "   This creates a HuggingFace-compatible dataset in: datasets/swiss_french/huggingface_export/"
echo ""

echo "βœ… Workflow demonstration complete!"
echo ""
echo "🎯 Next steps:"
echo "   1. Review the starter data in datasets/swiss_french/"
echo "   2. Add your own dictionary entries (CSV format)"
echo "   3. Generate and validate synthetic translations"
echo "   4. Fill in validation templates"
echo "   5. Collect data from GPSR, newspapers, native speakers"
echo "   6. When you have 20,000+ examples, export and train!"
echo ""
echo "πŸ“š Full documentation: SWISS_FRENCH_DATASET_GUIDE.md"
echo ""
echo "πŸ‡¨πŸ‡­ Bonne chance!"