Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- sa
|
| 5 |
+
task_categories:
|
| 6 |
+
- token-classification
|
| 7 |
+
- other
|
| 8 |
+
tags:
|
| 9 |
+
- sanskrit
|
| 10 |
+
- samasa
|
| 11 |
+
- sandhi
|
| 12 |
+
- compounding
|
| 13 |
+
- vigraha
|
| 14 |
+
- vyakarana
|
| 15 |
+
- boundary-detection
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# Sanskrit Sandhi + Samas Boundary Dataset — V3
|
| 19 |
+
|
| 20 |
+
The canonical merged training dataset for the **sanskrit-sandhi-boundary** model:
|
| 21 |
+
sentence-level **external sandhi** (corpus) + grammar-generated **samas**
|
| 22 |
+
(compounds, all 7 types) in one file.
|
| 23 |
+
|
| 24 |
+
## Composition
|
| 25 |
+
|
| 26 |
+
| Source | Rows | Description |
|
| 27 |
+
|--------|------|-------------|
|
| 28 |
+
| sandhi_corpus | 741,803 | running-text word boundaries (external sandhi) from `sanskrit-sandhi-boundaries-v2` |
|
| 29 |
+
| samas | 258,408 | grammar-generated compounds (7 types, laukik + alaukik vigraha) from `sanskrit-samas-v1` |
|
| 30 |
+
| **Total** | **~1,000,211** | one canonical training file |
|
| 31 |
+
|
| 32 |
+
## Design rationale
|
| 33 |
+
|
| 34 |
+
The splitter's task at a seam is **phonetically identical** for external sandhi
|
| 35 |
+
and internal compound boundaries — the model must fire at *every* valid seam and
|
| 36 |
+
stay quiet inside single words. Merging (not split-training) lets the shared
|
| 37 |
+
phonetics reinforce both, while the samas rows teach stem-co-occurrence for the
|
| 38 |
+
identity-concat class (no phonetic signal) and the corpus rows keep the real
|
| 39 |
+
distribution. See `benchmarks/PLAN_SAMAS.md`.
|
| 40 |
+
|
| 41 |
+
## Schema (per row)
|
| 42 |
+
|
| 43 |
+
| Field | Type | Description |
|
| 44 |
+
|-------|------|-------------|
|
| 45 |
+
| `seq` | string | SLP1 surface (input to the model) |
|
| 46 |
+
| `bnd` | list[int] | Boundary positions (last-char indices of each piece except the last) |
|
| 47 |
+
| `n_boundaries` | int | len(bnd) |
|
| 48 |
+
| `source` | string | `sandhi_corpus` or `samas` |
|
| 49 |
+
| `samasa_type` | string (opt) | one of 7 types, for samas rows |
|
| 50 |
+
| `stem1`, `stem2` | string (opt) | constituent stems, for samas rows |
|
| 51 |
+
| `verified` | bool | always true |
|
| 52 |
+
|
| 53 |
+
## Samasa type coverage (in the samas portion)
|
| 54 |
+
|
| 55 |
+
| Type | Meaning | n |
|
| 56 |
+
|------|---------|---|
|
| 57 |
+
| tatpuruṣa | determinative (X of Y) | 62,893 |
|
| 58 |
+
| karmadhāraya | appositional (X that is Y) | 62,893 |
|
| 59 |
+
| dvandva | copulative (X and Y) | 59,924 |
|
| 60 |
+
| bahuvrīhi | exocentric "having X" | 60,172 |
|
| 61 |
+
| avyayībhāva | adverbial | 7,097 |
|
| 62 |
+
| amreḍita | reduplicative | 5,091 |
|
| 63 |
+
| dvigu | numerical | 338 |
|
| 64 |
+
|
| 65 |
+
## Rebuilding
|
| 66 |
+
|
| 67 |
+
```bash
|
| 68 |
+
# samas dataset (deterministic, seed 42)
|
| 69 |
+
python3 benchmarks/build_samas_data.py --out data/samas_V1.jsonl
|
| 70 |
+
|
| 71 |
+
# merged dataset (deterministic, seed 42)
|
| 72 |
+
python3 benchmarks/merge_datasets.py \
|
| 73 |
+
--sandhi data/train_V2_full.jsonl \
|
| 74 |
+
--samas data/samas_V1.jsonl \
|
| 75 |
+
--out data/train_V3_sandhi_samas.jsonl
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
## Related
|
| 79 |
+
|
| 80 |
+
- Samas-only: [`sanskrit-samas-v1`](https://huggingface.co/datasets/CodeIsAbstract/sanskrit-samas-v1)
|
| 81 |
+
- Sandhi-only: [`sanskrit-sandhi-boundaries-v2`](https://huggingface.co/datasets/CodeIsAbstract/sanskrit-sandhi-boundaries-v2)
|
| 82 |
+
- Benchmark: [`sanskrit-sandhi-boundary-v2`](https://huggingface.co/CodeIsAbstract/sanskrit-sandhi-boundary-v2) (model)
|