diff --git "a/tools/README.md" "b/tools/README.md" --- "a/tools/README.md" +++ "b/tools/README.md" @@ -1,12911 +1,131 @@ ---- -### THIS IS A GENERATED FILE. -viewer: false - -annotations_creators: -- expert-generated - -language_creators: -- crowdsourced - -language: -- abq -- af -- akk -- aqz -- sq -- gsw -- am -- grc -- hbo -- apu -- ar -- hy -- aii -- bm -- eu -- bej -- be -- bn -- bho -- br -- bg -- bxr -- yue -- cpg -- ca -- ceb -- ckb -- zh -- ckt -- lzh -- cop -- hr -- cs -- da -- nl -- en -- myv -- et -- fo -- fi -- fr -- qfn -- gl -- ka -- de -- got -- el -- gub -- gn -- he -- hi -- hit -- hu -- is -- id -- ga -- it -- ja -- jv -- urb -- xnr -- krl -- arr -- kk -- naq -- kfm -- quc -- koi -- kpv -- ko -- ky -- la -- lv -- lij -- lt -- olo -- nds -- mk -- jaa -- qaf -- mpu -- mt -- gv -- mr -- gun -- mdf -- myu -- nyq -- nap -- sme -- kmr -- 'no' -- oc -- or -- cu -- orv -- fro -- sga -- otk -- fa -- pl -- qpm -- pt -- ro -- ru -- sa -- gd -- sr -- si -- sms -- sk -- sl -- soj -- ajp -- es -- sv -- swl -- tl -- ta -- tt -- eme -- te -- th -- tpn -- tr -- qtd -- uk -- hsb -- ur -- ug -- vi -- wbp -- cy -- hyw -- nhi -- wo -- sjo -- sah -- yo -- ess - -license: -- apache-2.0 - -multilinguality: -- multilingual - -size_categories: -- '1K .env + ``` + - In `00_fetch_ud_clarin-dspace_metadata.py`, add a new entry to the + `url_postfixes` dict, e.g. + ``` + "2.17": "11234/1-6000", # , released + ``` + - Fetch the metadata artefacts: + ``` + ./00_fetch_ud_clarin-dspace_metadata.py -o + ``` + +3. **Add/update docs-commit mapping** + - In `00_fetch_ud_codes_and_flags.sh`, append the git hash for the new + release to `VER_MAPPING`, e.g. + ``` + VER_MAPPING["2.17"]="bea0c0e56c64cad41e60f479a8eca87dc571113f" + ``` + - Refresh the codes/flags map and fetch the repositories list: + ``` + ./00_fetch_ud_codes_and_flags.sh -o + ./01_fetch_ud_repos.sh + ``` + - Commit the newly generated and changed files: + ``` + git commit -m "Add PID,docs-commit info for new version" \ + tools/00_fetch_ud_clarin-dspace_metadata.py tools/00_fetch_ud_codes_and_flags.sh + + git add etc/codes_and_flags-${NEW_VER}.yaml + git commit -m"Add etc/codes_and_flags-${NEW_VER}.yaml" \ + etc/codes_and_flags-${NEW_VER}.yaml + + git commit -m"Bump to ${NEW_VER}: etc/codes_and_flags-latest.yaml" \ + etc/codes_and_flags-latest.yaml + ``` + +4. **Create the NEW_VER repositories branch** + ``` + cd UD_repos/ # change into the directory with all UD data + git checkout -b ${NEW_VER} + . .UD_submodules_add.commands # update/initialise submodules + git add -u # add new content (!check for new directories/content) + # FIXME: + git submodule foreach git status | grep -v .tag- | grep -v Entering | grep -v HEAD | grep -v Untracked | grep -v '' | grep -v nothing | grep -v master + git commit -m "Bump to ${NEW_VER}" + cd .. + ``` + +5. **Regenerate metadata, README, and Python template** + ``` + ./02_traverse_ud_repos.py -o + ./03_fill_universal_dependencies_tamplate.py -o + ``` + Review the generated files (`README-${NEW_VER}`, `metadata-${NEW_VER}.json`, + `universal_dependencies-${NEW_VER}`) before committing. + +6. **Generate and check parquet files** + (Update blocked_treebanks.yaml - if necessary. See BLOCKED_TREEBANKS.md) + ``` + uv run tools/04_generate_parquet.py + + uv run tools/05_validate_parquet.py --local --mode text -vv > /tmp/parquet-check.log + # Check for differences outside the metadata headers: + grep -E " [+-]" /tmp/parquet-check.log | grep -vE " [+-]#" + ``` + +7. **Commit and sync artefacts** + ``` + git add README-${NEW_VER} metadata-${NEW_VER}.json universal_dependencies-${NEW_VER} + git commit -m "Add README-${NEW_VER} metadata-${NEW_VER}.json universal_dependencies-${NEW_VER}" + + cp README-${NEW_VER} ../README.md + cp metadata-${NEW_VER}.json ../metadata.json + cp universal_dependencies-${NEW_VER} ../universal_dependencies.py + git add ../parquet + git commit -m "Bump to ${NEW_VER}: README.md metadata.json universal_dependencies.py parquet/" ../README.md ../metadata.json ../universal_dependencies.py + + git checkout main + git merge ${NEW_VER} + git push origin ${NEW_VER} + git push origin main + ``` + Adjust the final push commands if your workflow requires pull requests or + protected branches. + + +## Overview of files and directories +1. **00 (./etc/)** + - `00_fetch_ud_clarin-dspace_metadata.py` + Download `./etc/citation-VER` and `./etc/description-VER` UD metadata files for + the different releases from the lindat clarin-dspace repository. + + - `00_fetch_ud_codes_and_flags.sh` + Download `./etc/codes_and_flags.yaml`, a yaml file mapping UD (long) language + names to metadata from UD `docs-automation` at GitHub. + +2. **01** + - Identify all relevant UD repositories from GitHub: + * https://github.com/UniversalDependencies/ + and generate a list of submodules to add to a (newly created) repository in the + subdirectory `./UD_Repos/`. + +3. **02** + - Collect relevant metadata from local UD directories: + - extract the '# Summary' from the beginning and machine readable + metadata from the end of the README.{md,txt} file + - use the UD directory name for collecting metadata from the + codes_and_flags.yaml file + - collect {dev,train,test}.conllu files. + +4. **03** + Use `./templates/` and generate: + - `universal_dependencies.py` + - `README.md`