karma689 commited on
Commit
aaa34f0
·
verified ·
1 Parent(s): 589affe

Upload folder using huggingface_hub

Browse files
Files changed (5) hide show
  1. README.md +55 -63
  2. benchmark.parquet +3 -0
  3. test.parquet +3 -0
  4. train.parquet +3 -0
  5. validation.parquet +3 -0
README.md CHANGED
@@ -1,83 +1,75 @@
1
  ---
2
  language:
3
- - bo
4
  license: cc0-1.0
5
- size_categories:
6
- - 1k<n<10k
7
  task_categories:
8
- - image-classification
9
  tags:
10
- - tibetan
11
- - manuscript
12
- - uchen
13
- - ume
14
- - script-classification
15
- - training-data
16
- dataset_info:
17
- features:
18
- - name: image
19
- dtype: image
20
- - name: label
21
- dtype:
22
- class_label:
23
- names:
24
- 0: uchen
25
- 1: ume
26
- - name: source
27
- dtype: string
28
- splits:
29
- - name: train
30
- num_examples: 3048
31
- - name: validation
32
- num_examples: 762
33
- - name: test
34
- num_examples: 762
35
  ---
36
 
37
- # Uchen-Ume Classification Training Dataset
 
 
 
 
38
 
39
- This repository contains the primary training and evaluation data for the **Uchen-Ume Classifier**. This dataset is used to train models to distinguish between formal "headed" block scripts (**Uchen**) and cursive "headless" script families (**Ume**).
 
40
 
41
- ## Repository Structure
42
 
43
- The dataset is organized into three main directories to support different training and validation stages:
 
 
 
44
 
45
- * **`source/`**: Contains the raw, original manuscript images as provided by BDRC.
46
- * **`preprocessed/`**: Contains three variants of the data used for different experiments:
47
- * `whole_page`: Images resized (short-edge 224px) and **center-cropped** to 224x224.
48
- * `patches_color`: Images split into **5 to 6 patches** per page with a **10% overlap**.
49
- * `patches_clahe`: Same 10% overlap patch layout, but with **Contrast Limited Adaptive Histogram Equalization (CLAHE)** applied to improve stroke visibility in low-contrast scans.
50
- * **`benchmark/`**: A "Gold Standard" evaluation set containing exactly **5 images per class** across 18 script types. These images were selected after a strict taxonomical cleanup and were **never seen** by the model during the training, validation, or testing phases.
51
 
52
- ## Project Context
53
- - **Project:** The BDRC Etext Corpus
54
- - **Developed by:** Dharmaduta in collaboration with BDRC
55
- - **Source of Images:** [Buddhist Digital Resource Center (BDRC)](https://www.bdrc.io)
56
- - **Funding:** Khyentse Foundation
57
- - **License:** CC0 (Public Domain)
58
 
59
- ## Dataset Stats & Splits
 
 
 
 
60
 
61
- The following numbers represent the data used for the main Uchen-Ume binary classification task:
62
 
63
- - **Train:** 3,048 images
64
- - **Validation:** 762 images
65
- - **Test:** 762 images
66
- - **Total Samples:** 4,572
67
 
68
- ### Balanced Class Distribution
69
- - **Uchen (Class 0):** 2,286 images (includes `uchen_sugdring`, `uchen_sugthung`)
70
- - **Ume (Class 1):** 2,286 images (includes `petsuk`, `peri`, `tsegdrig`, `khyuyig`, etc.)
71
 
72
- ## Selection & Tagging Methodology
73
 
74
- ### Selection Process
75
- Images were selected from the BDRC digital library to provide a comprehensive representation of Tibetan script geometry. To maintain a clean binary signal, we manually excluded pages that were "Difficult," "Multi-script," or "Non-Tibetan" from this specific training set.
 
 
76
 
77
- ### Annotation
78
- Tagging was performed using a custom-developed script classification tool developed by **Dharmaduta** and **BDRC**.
79
- - **Expert Review:** A team of expert Tibetan paleographers reviewed every scan to assign ground-truth labels.
80
- - **Taxonomical Cleanup:** The `benchmark` folder specifically reflects a cleaned taxonomy, ensuring that the 18 sub-classes are correctly represented for the most rigorous model testing possible.
81
 
82
- ## Acknowledgments
83
- We thank the **Buddhist Digital Resource Center** for their archive and the **Khyentse Foundation** for funding **The BDRC Etext Corpus** project.
 
1
  ---
2
  language:
3
+ - bo
4
  license: cc0-1.0
 
 
5
  task_categories:
6
+ - image-classification
7
  tags:
8
+ - tibetan
9
+ - uchen
10
+ - ume
11
+ - manuscript
12
+ size_categories:
13
+ - 10K<n<100K
14
+ configs:
15
+ - config_name: default
16
+ data_files:
17
+ - split: train
18
+ path: train.parquet
19
+ - split: validation
20
+ path: validation.parquet
21
+ - split: test
22
+ path: test.parquet
23
+ - split: benchmark
24
+ path: benchmark.parquet
 
 
 
 
 
 
 
 
25
  ---
26
 
27
+ # Uchen vs Umê classification (Parquet)
28
+
29
+ Binary Tibetan script labels: **uchen** / **ume**.
30
+
31
+ ## Load with ``datasets``
32
 
33
+ ```python
34
+ from datasets import load_dataset
35
 
36
+ repo = "openpecha/uchen-ume-classification-benchmark" # replace after upload
37
 
38
+ train = load_dataset(repo, split="train")
39
+ val = load_dataset(repo, split="validation")
40
+ test = load_dataset(repo, split="test")
41
+ bench = load_dataset(repo, split="benchmark")
42
 
43
+ # Or all splits at once:
44
+ ds = load_dataset(repo)
45
+ # ds["train"], ds["validation"], ds["test"], ds["benchmark"]
46
+ ```
 
 
47
 
48
+ ## Columns
 
 
 
 
 
49
 
50
+ | Column | Type | Description |
51
+ |--------|------|-------------|
52
+ | `id` | string | BDRC page id (filename stem) |
53
+ | `image_bytes` | binary | Raw image file bytes (JPEG/PNG, …) |
54
+ | `script` | string | `uchen` or `ume` |
55
 
56
+ Decode an image:
57
 
58
+ ```python
59
+ from io import BytesIO
60
+ from PIL import Image
 
61
 
62
+ row = train[0]
63
+ img = Image.open(BytesIO(row["image_bytes"])).convert("RGB")
64
+ ```
65
 
66
+ ## Splits
67
 
68
+ | Split | Source |
69
+ |-------|--------|
70
+ | `train` / `validation` / `test` | Work-stratified split from training corpus (benchmark pages excluded) |
71
+ | `benchmark` | Held-out diverse pages (`select_benchmark.py`) — **not** in train/val/test |
72
 
73
+ ## Training exclusion
 
 
 
74
 
75
+ Pages in ``benchmark`` are excluded from train/val/test via ``benchmark_page_ids.json`` when building splits.
 
benchmark.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4bd950edb423259afd414a7815d444f8c3a025bbd82fb4d5b5db2a6fc853a6df
3
+ size 40931078
test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94176eac9f6ec887eb7995c5fee886b32e9c888f186a1bb73affd1f3dbf53b23
3
+ size 556902632
train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b48881cbabdf7f50132c363a7e146b175069c84488e7d23e760730ab7495095
3
+ size 5506315731
validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e82c22321ff25170779682a1bc8b46171db2c0234ef5ac0c28a399f8463712c
3
+ size 630217530