Copies/Script.org

4.6 KiB
Raw Blame History

Script

NEEDS :

  • `export GEMINI_API_KEY=…`
  • fichier `names` in the directory.

Prétraitement

  1. Rotate every single page 180 `./rotate_all.sh Interro14`
  2. `./rename_to_copie.sh Interro14`
  3. `python page_splitter.py Interro`. Fix issues with `python page_splitter.py Interro14/Copie01.pdf`
  4. `python cutleft.py Interro` Rerun on a single file with `python cutleft.py Interro/Copie01.pdf`
  5. `python enonce_info.py Interro`

Labelisation et regroupement

Set proxy with `export HTTPS_PROXY="http://192.168.241.1:3128"`

  1. `python gemini_for_labels.py Interro`, avec éventuellement `overwrite`
  2. Vérification visuelle : `python plotting.py Interro` `python plotting.py InterroTest/Copie01.pdf`

    It also generates les `Copie01.json`, à partir des `Copie01_01.json`

    In case of issue, you may need to

    • Reorder the pdf
    • Run `python cutleft.py Interro/Copie`
    • Run `python gemini_dir_batching.py Interro/Copie`
  3. `python splitting_int.py Interro`
  4. `python grouping.py Interro`

Correction et annotation

Success! Batch Job Name: batches/0hc83m3anayrs5iljygg2v6ozsvxz58k6a5r

Processing batch_requests_pro.jsonl for model gemini-3.1-pro-preview… Uploading file… Uploaded successfully! File ID: files/oasj4aty5kco Starting batch job… Success! Batch Job Name: batches/8pk4m2snr17n31pun3vwzn646qvtkj8ao192

Set proxy with `export HTTPS_PROXY="http://10.0.0.1:3128"`

  1. Il faut créer des persp, pour indication de comment corriger, et relancer `enonce_info.py`
  2. `python correction.py Interro limit 240` OU `python correction.py Interro/Ex\ 2/Group_1.jpg` OU `python correction.py Interro overwrite`

    Will it resume ? It seems so. Best to wait a bit. To batch it :

    • `python correction.py Interro batch`
    • `python submit_batches.py Interro`
    • `python batch_status.py`
    • `python fetch_batched_results.py DS08VB`
    • `python correction.py DS08VB deal-with-batched`
  3. Try `python post-correction.py Interro` ; It makes a `fixed_correction.json`, to check.
  4. Facultatif : `python annotating.py Interro` dans `Anot`, pass `overwrite`
    • `python annotating_with_checks.py Interro` dans `Bnot`, pass `overwrite`

    OU

    • `python annotating_by_label.py Interro` dans `BGnot` Needs : label_groups file. (made automatically by this function)
  5. `python to_tablette.py Interro` Cela déplace les groupes dans `SyncCopies/À Annoter`.

    • Les mettre dans le dossier racine de la tablette, et renommer en `aaa`.
    • Vider `Syncthing/Annotées` sur la tablette et localement. À automatiser, aussi c'est lent…

Lecture de la correction manuelle

  1. Manually : delete `~/SyncCopies/Annotées`, copy from the tablette to here. Then `python from_tablette.py Interro`
    • `python reading_annotations.py Interro`

    OU

    • `python reading_grouped_annotations.py Interro`
  2. `python giving_names.py InterroTest BGnot`

    It will make `A Rendre` with symlink to the Concat.jpg file either in Anot or Bnot, and score.json.

    • In case of Unknown : rename both directory and file inside.
    • Here, you can change `score.json` manually.
    • `gestion_classe ne` pour créer l'interro puis
    • `gestion_classe we` (set barème here)
    • `python update_ods.py Interro`
    • `gestion_classe re`
    • `gestion_classe wsent`
    • `python add_final_score.py Interro21` (this makes files in `Server/copies`)
    • Deploy `miqmacs-copies-assets`, and
    • update the copies from `miqmacs.fr/admin`.

Recorrection d'une seule copie

!! Attention, refaire ne marchera pas si tu fais une annotation non groupée into refaire !!

  1. Redécoupage

    • `python plotting.py InterroTest/Copie01.pdf`
    • `python splitting_int.py InterroTest/Copie20.pdf`
  2. Créer `refaire.json`, avec un contenu comme /sebastien/Copies/src/commit/4a77f0905b4538e88c6aadf5b6179d73c9328ace/"Copie01&%2334;,%20%5B, ["Copie01", ["Ex 1 : 1)"]]]
  3. Appeler `correction` avec refaire. Il doit créer des groupes individuels, faire des requêtes, et remplacer les corrections précédentes (à sauver ailleurs). Ou non, si tu veux le faire à la main.
  4. ?? Si je fais refaire, avant d'avoir créer les annotating with checks, que se passe-t-il ???
  5. Appeler `annotating_with_checks.py refaire overwrite` avec refaire.
  6. `python to_tablette.py refaire Interro24`
  7. `python from_tablette.py refaire Interro24`
  8. `python reading_grouped_annotations.py refaire Interro24`

Install

pip install highlight-text --break-system-packages