Datasets:
Update doc info for new version
Browse files- tools/README.md +103 -65
tools/README.md
CHANGED
|
@@ -1,83 +1,121 @@
|
|
| 1 |
# README
|
| 2 |
|
| 3 |
-
## Add a new version
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
1.
|
| 8 |
-
`00_fetch_ud_clarin-dspace_metadata.py`, like:
|
| 9 |
-
> "2.16": "11234/1-5901", # 319 treebanks, 179 languages, released May 15, 2025.
|
| 10 |
-
|
| 11 |
-
and execute:
|
| 12 |
-
```
|
| 13 |
-
./00_fetch_ud_clarin-dspace_metadata.py
|
| 14 |
-
```
|
| 15 |
-
|
| 16 |
-
1. Add a line to `ARRAY:VER_MAPPINGS` in the file
|
| 17 |
-
`00`, like:
|
| 18 |
-
> VER_MAPPING["2.16"]="bc0cc9b94112253e3ea1e00b2dbe3a46c5f53fe3"
|
| 19 |
-
|
| 20 |
-
and execute:
|
| 21 |
```
|
| 22 |
-
|
| 23 |
-
./01_fetch_ud_repos.sh
|
| 24 |
```
|
| 25 |
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
```
|
| 28 |
-
cd UD_repos/
|
| 29 |
-
git checkout -b
|
| 30 |
-
. .UD_submodules_add.commands
|
| 31 |
-
git add -u
|
| 32 |
-
|
|
|
|
|
|
|
| 33 |
cd ..
|
| 34 |
```
|
| 35 |
|
| 36 |
-
|
| 37 |
```
|
| 38 |
./02_traverse_ud_repos.py -o
|
| 39 |
./03_fill_universal_dependencies_tamplate.py -o
|
| 40 |
-
|
| 41 |
-
git log # find the HASH *before* the "WIP" and
|
| 42 |
-
git reset HASH
|
| 43 |
-
git add README-2.16 metadata-2.16.json universal_dependencies-2.16
|
| 44 |
-
git commit -m"Add README-2.16 metadata-2.16.json universal_dependencies-2.16"
|
| 45 |
-
git checkout -b 2.16
|
| 46 |
-
cp README-2.16 ../README.md ; cp metadata-2.16.json ../metadata.json ; cp universal_dependencies-2.16 ../universal_dependencies.py
|
| 47 |
-
git commit -m"Sync README.md metadata.json universal_dependencies.py" ../README.md ../metadata.json ../universal_dependencies.py
|
| 48 |
-
git checkout main
|
| 49 |
-
git commit -m"WIP: 2.16 - Sync README.md metadata.json universal_dependencies.py" ../README.md ../metadata.json ../universal_dependencies.py
|
| 50 |
-
git push origin 2.14
|
| 51 |
-
git push -f origin main
|
| 52 |
```
|
|
|
|
|
|
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
### `00_fetch_ud_codes_and_flags.sh`
|
| 60 |
-
Download `./etc/codes_and_flags.yaml`, a yaml file mapping UD (long) language
|
| 61 |
-
names to metadata from UD `docs-automation` at GitHub.
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
## 01
|
| 65 |
-
Identify all relevant UD repositories from GitHub:
|
| 66 |
-
* https://github.com/UniversalDependencies/
|
| 67 |
-
and generate a list of submodules to add to a (newly created) repository in the
|
| 68 |
-
subdirectory `./UD_Repos/`.
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
## 02
|
| 72 |
-
Collect relevant metadata from local UD directories:
|
| 73 |
-
- extracting the '# Summary' from the beginning and machine readable
|
| 74 |
-
metadata from the end of the README.{md,txt} file
|
| 75 |
-
- using the UD directory name for collecting metadata from the
|
| 76 |
-
codes_and_flags.yaml file
|
| 77 |
-
- collecting {dev,train,test}.conllu files.
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
-
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# README
|
| 2 |
|
| 3 |
+
## Add a new version
|
| 4 |
|
| 5 |
+
Use `NEW_VER` as the placeholder in the steps below (for example `2.17`). Keep
|
| 6 |
+
commands idempotent by running scripts with the `-o/--override` flag whenever a
|
| 7 |
+
file already exists.
|
| 8 |
|
| 9 |
+
1. **Start new branch ${NEW_VER}**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
```
|
| 11 |
+
git checkout -b ${NEW_VER}
|
|
|
|
| 12 |
```
|
| 13 |
|
| 14 |
+
2. **Add PID info**
|
| 15 |
+
- Edit `.env` and set `UD_VER=NEW_VER`:
|
| 16 |
+
```
|
| 17 |
+
NEW_VER=2.17
|
| 18 |
+
echo "UD_VER=${NEW_VER}" > .env
|
| 19 |
+
```
|
| 20 |
+
- In `00_fetch_ud_clarin-dspace_metadata.py`, add a new entry to the
|
| 21 |
+
`url_postfixes` dict, e.g.
|
| 22 |
+
```
|
| 23 |
+
"2.17": "11234/1-6000", # <treebanks/languages>, released <date>
|
| 24 |
+
```
|
| 25 |
+
- Fetch the metadata artefacts:
|
| 26 |
+
```
|
| 27 |
+
./00_fetch_ud_clarin-dspace_metadata.py -o
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
3. **Add/update docs-commit mapping**
|
| 31 |
+
- In `00_fetch_ud_codes_and_flags.sh`, append the git hash for the new
|
| 32 |
+
release to `VER_MAPPING`, e.g.
|
| 33 |
+
```
|
| 34 |
+
VER_MAPPING["2.17"]="bea0c0e56c64cad41e60f479a8eca87dc571113f"
|
| 35 |
+
```
|
| 36 |
+
- Refresh the codes/flags map and fetch the repositories list:
|
| 37 |
+
```
|
| 38 |
+
./00_fetch_ud_codes_and_flags.sh -o
|
| 39 |
+
./01_fetch_ud_repos.sh
|
| 40 |
+
```
|
| 41 |
+
- Commit the newly generated and changed files:
|
| 42 |
+
```
|
| 43 |
+
git commit -m "Add PID,docs-commit info for new version" \
|
| 44 |
+
tools/00_fetch_ud_clarin-dspace_metadata.py tools/00_fetch_ud_codes_and_flags.sh
|
| 45 |
+
|
| 46 |
+
git add etc/codes_and_flags-${NEW_VER}.yaml
|
| 47 |
+
git commit -m"Add etc/codes_and_flags-${NEW_VER}.yaml" \
|
| 48 |
+
etc/codes_and_flags-${NEW_VER}.yaml
|
| 49 |
+
|
| 50 |
+
git commit -m"Bump to ${NEW_VER}: etc/codes_and_flags-latest.yaml" \
|
| 51 |
+
etc/codes_and_flags-latest.yaml
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
4. **Create the NEW_VER repositories branch**
|
| 55 |
```
|
| 56 |
+
cd UD_repos/ # change into the directory with all UD data
|
| 57 |
+
git checkout -b ${NEW_VER}
|
| 58 |
+
. .UD_submodules_add.commands # update/initialise submodules
|
| 59 |
+
git add -u # add new content (!check for new directories/content)
|
| 60 |
+
# FIXME:
|
| 61 |
+
git submodule foreach git status | grep -v .tag- | grep -v Entering | grep -v HEAD | grep -v Untracked | grep -v '<file>' | grep -v nothing | grep -v master
|
| 62 |
+
git commit -m "Bump to ${NEW_VER}"
|
| 63 |
cd ..
|
| 64 |
```
|
| 65 |
|
| 66 |
+
5. **Regenerate metadata, README, and Python template**
|
| 67 |
```
|
| 68 |
./02_traverse_ud_repos.py -o
|
| 69 |
./03_fill_universal_dependencies_tamplate.py -o
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
```
|
| 71 |
+
Review the generated files (`README-${NEW_VER}`, `metadata-${NEW_VER}.json`,
|
| 72 |
+
`universal_dependencies-${NEW_VER}`) before committing.
|
| 73 |
|
| 74 |
+
6. **Commit and sync artefacts**
|
| 75 |
+
```
|
| 76 |
+
git add README-${NEW_VER} metadata-${NEW_VER}.json universal_dependencies-${NEW_VER}
|
| 77 |
+
git commit -m "Add README-${NEW_VER} metadata-${NEW_VER}.json universal_dependencies-${NEW_VER}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
+
cp README-${NEW_VER} ../README.md
|
| 80 |
+
cp metadata-${NEW_VER}.json ../metadata.json
|
| 81 |
+
cp universal_dependencies-${NEW_VER} ../universal_dependencies.py
|
| 82 |
+
git commit -m "Sync README.md metadata.json universal_dependencies.py" ../README.md ../metadata.json ../universal_dependencies.py
|
| 83 |
|
| 84 |
+
git checkout main
|
| 85 |
+
git merge ${NEW_VER}
|
| 86 |
+
git commit -m "Bump to ${NEW_VER}: README.md metadata.json universal_dependencies.py" ../README.md ../metadata.json ../universal_dependencies.py
|
| 87 |
+
git push origin ${NEW_VER}
|
| 88 |
+
git push -f origin main
|
| 89 |
+
```
|
| 90 |
+
Adjust the final push commands if your workflow requires pull requests or
|
| 91 |
+
protected branches.
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
## Overview of files and directories
|
| 95 |
+
1. **00 (./etc/)**
|
| 96 |
+
- `00_fetch_ud_clarin-dspace_metadata.py`
|
| 97 |
+
Download `./etc/citation-VER` and `./etc/description-VER` UD metadata files for
|
| 98 |
+
the different releases from the lindat clarin-dspace repository.
|
| 99 |
+
|
| 100 |
+
- `00_fetch_ud_codes_and_flags.sh`
|
| 101 |
+
Download `./etc/codes_and_flags.yaml`, a yaml file mapping UD (long) language
|
| 102 |
+
names to metadata from UD `docs-automation` at GitHub.
|
| 103 |
+
|
| 104 |
+
2. **01**
|
| 105 |
+
- Identify all relevant UD repositories from GitHub:
|
| 106 |
+
* https://github.com/UniversalDependencies/
|
| 107 |
+
and generate a list of submodules to add to a (newly created) repository in the
|
| 108 |
+
subdirectory `./UD_Repos/`.
|
| 109 |
+
|
| 110 |
+
3. **02**
|
| 111 |
+
- Collect relevant metadata from local UD directories:
|
| 112 |
+
- extract the '# Summary' from the beginning and machine readable
|
| 113 |
+
metadata from the end of the README.{md,txt} file
|
| 114 |
+
- use the UD directory name for collecting metadata from the
|
| 115 |
+
codes_and_flags.yaml file
|
| 116 |
+
- collect {dev,train,test}.conllu files.
|
| 117 |
+
|
| 118 |
+
4. **03**
|
| 119 |
+
Use `./templates/` and generate:
|
| 120 |
+
- `universal_dependencies.py`
|
| 121 |
+
- `README.md`
|