mohanprakash462 commited on
Commit
8798ef5
·
verified ·
1 Parent(s): 5ed27b0

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +133 -3
README.md CHANGED
@@ -1,3 +1,133 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ta
4
+ license: cc-by-sa-4.0
5
+ task_categories:
6
+ - text-generation
7
+ tags:
8
+ - tamil
9
+ - morphology
10
+ - benchmark
11
+ - evaluation
12
+ - linguistics
13
+ - dravidian
14
+ - agglutinative
15
+ pretty_name: "Tamil Morphological Generalization Benchmark"
16
+ size_categories:
17
+ - 1K<n<10K
18
+ ---
19
+
20
+ # Tamil Morphological Generalization Benchmark (TAMIL-MORPH)
21
+
22
+ **The first morphological generalization benchmark for Tamil** -- 1,030 test cases across 9 categories designed to evaluate whether LLMs truly understand Tamil morphological rules or merely memorize surface forms.
23
+
24
+ **Paper:** *"A Thousand Language Problem: Morphological Understanding in Linguistic AI"*
25
+
26
+ ## Benchmark Overview
27
+
28
+ | Category | Test Cases | Description |
29
+ |----------|-----------|-------------|
30
+ | Case Suffixes (வேற்றுமை) | 240 | 6 grammatical cases across 40 noun roots |
31
+ | Plural + Case (பன்மை) | ~160 | Plural formation with case markers |
32
+ | Verb Conjugation (வினைத்திரிபு) | ~210 | 7 person-tense combinations across verb roots |
33
+ | Sandhi (புணர்ச்சி) | ~50 | Sound changes at word boundaries |
34
+ | Honorific Forms (மரியாதை) | ~90 | Informal/formal/high-respect registers |
35
+ | Negation (எதிர்மறை) | ~90 | Present/past/future negative forms |
36
+ | Compound Words (கூட்டுச்சொல்) | ~50 | Word joining rules |
37
+ | Conditional/Causal (நிபந்தனை) | ~60 | Conditional and causal suffixes |
38
+ | Novel Combinations (புதிய வடிவங்கள்) | ~80 | Multi-suffix forms never seen in training |
39
+ | **Total** | **1,030** | |
40
+
41
+ ## Baseline Results
42
+
43
+ | Model | Overall Accuracy |
44
+ |-------|-----------------|
45
+ | GPT-4o-mini | 54.0% |
46
+
47
+ ## Files
48
+
49
+ - `Benchmarkdata.md` -- Full benchmark data (JSON arrays in Markdown)
50
+ - `morph_benchmark_eval.py` -- Complete evaluation script (supports local HF models, OpenAI, Google Gemini backends)
51
+ - `baselines/gpt-4o-mini_results.json` -- Detailed per-test results for GPT-4o-mini
52
+ - `kaggle_benchmark.ipynb` -- Ready-to-run Kaggle notebook for benchmarking
53
+ - `runpod_benchmark.py` -- RunPod GPU benchmarking script
54
+
55
+ ## Usage
56
+
57
+ ### Run evaluation locally
58
+
59
+ ```bash
60
+ # With OpenAI API
61
+ python morph_benchmark_eval.py --model gpt-4o-mini --backend openai
62
+
63
+ # With Google Gemini (free tier)
64
+ python morph_benchmark_eval.py --model gemini-2.0-flash --backend gemini
65
+
66
+ # With local HuggingFace model
67
+ python morph_benchmark_eval.py --model Tamil-ai/tamil-qwen25-7b-instruct --backend local
68
+
69
+ # Run all configured models
70
+ python morph_benchmark_eval.py --all
71
+ ```
72
+
73
+ ### Load benchmark data programmatically
74
+
75
+ ```python
76
+ from huggingface_hub import hf_hub_download
77
+ import json, re
78
+ from pathlib import Path
79
+
80
+ path = hf_hub_download(
81
+ repo_id="Tamil-ai/tamil-morphological-benchmark",
82
+ filename="Benchmarkdata.md",
83
+ repo_type="dataset",
84
+ )
85
+ # Parse JSON blocks from the markdown (see morph_benchmark_eval.py for full parser)
86
+ ```
87
+
88
+ ## Data Format
89
+
90
+ Each category contains structured JSON with roots, meanings, and expected morphological forms:
91
+
92
+ ```json
93
+ {
94
+ "root": "வீடு",
95
+ "root_meaning": "house",
96
+ "forms": {
97
+ "accusative": {"tamil": "வீட்டை", "meaning": "the house (object)"},
98
+ "dative": {"tamil": "வீட்டுக்கு", "meaning": "to the house"},
99
+ "locative": {"tamil": "வீட்டில்", "meaning": "in the house"}
100
+ }
101
+ }
102
+ ```
103
+
104
+ ## Scoring
105
+
106
+ - **1.0** -- Exact match (after Tamil text normalization)
107
+ - **0.5** -- Partial match (predicted is substring of expected)
108
+ - **0.0** -- Wrong
109
+
110
+ ## Why This Benchmark?
111
+
112
+ Existing Tamil NLP benchmarks test translation or classification. None test whether models understand the **generative morphological rules** of Tamil -- an agglutinative language where a single root can produce hundreds of valid surface forms through suffix combinations.
113
+
114
+ This benchmark is transferable to other agglutinative languages (Turkish, Finnish, Hungarian, Korean, etc.) by replacing the morphological rules.
115
+
116
+ ## Validation
117
+
118
+ All 1,030 test cases were validated using:
119
+ 1. Finite State Transducer (FST) analysis
120
+ 2. Stanza NLP morphological parser
121
+ 3. Manual rule verification
122
+
123
+ ## Citation
124
+
125
+ ```bibtex
126
+ @misc{tamilmorph2026,
127
+ title={A Thousand Language Problem: Morphological Understanding in Linguistic AI},
128
+ author={Tamil-AI},
129
+ year={2026},
130
+ publisher={HuggingFace},
131
+ url={https://huggingface.co/datasets/Tamil-ai/tamil-morphological-benchmark}
132
+ }
133
+ ```