Spaces:
Running on Zero
Running on Zero
Upload folder using huggingface_hub
Browse files- app.py +27 -15
- assets/fig_data.png +0 -0
- assets/fig_domains.png +0 -0
- assets/fig_overall.png +0 -0
- assets/fig_pipeline.png +0 -0
- assets/fig_validated.png +0 -0
app.py
CHANGED
|
@@ -67,7 +67,7 @@ CSS = """
|
|
| 67 |
HERO = """<div id="hero"><div class="in">
|
| 68 |
<h1>اردو <span class="a">Education & Reasoning</span></h1>
|
| 69 |
<p>A Gemma-3-4B model adapted to Urdu by translating English knowledge corpora into Urdu with
|
| 70 |
-
<b>Adaption AutoScientist</b>
|
| 71 |
<div class="badges"><span class="b">Gemma-3-4B</span><span class="b">Adaption AutoScientist</span>
|
| 72 |
<span class="b">UrduMMLU 46.2%</span><span class="b">+1.3 vs base</span></div></div></div>"""
|
| 73 |
|
|
@@ -76,20 +76,26 @@ KPI = """<div class="kpi">
|
|
| 76 |
<div class="c"><div class="v">+3.6</div><div class="l">Profession</div></div>
|
| 77 |
<div class="c"><div class="v">+2.7</div><div class="l">Social Sci.</div></div>
|
| 78 |
<div class="c"><div class="v">46.2%</div><div class="l">UrduMMLU overall</div></div>
|
| 79 |
-
<div class="c"><div class="v">
|
| 80 |
|
| 81 |
-
|
| 82 |
-
<p>
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
Pakistani Urdu — adding richer prompts and English reasoning traces — and supervised-fine-tuned Gemma-3-4B on the result.</p></div>"""
|
| 87 |
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
FOOT = """<div id="foot">Model: <a href="https://huggingface.co/abdullah693/gemma-3-4b-it-urdu-edu-reasoning" target="_blank">abdullah693/gemma-3-4b-it-urdu-edu-reasoning</a>
|
| 95 |
· Adapted with <b>Adaption AutoScientist</b> · Eval: <a href="https://huggingface.co/datasets/MBZUAI/UrduMMLU" target="_blank">UrduMMLU</a> (Urdu, 0-shot)<br>
|
|
@@ -111,13 +117,19 @@ with gr.Blocks(title="Urdu Education & Reasoning", theme=gr.themes.Soft(primary_
|
|
| 111 |
mt = gr.Slider(64, 512, value=256, step=32, label="Max new tokens")
|
| 112 |
tp = gr.Slider(0.0, 1.0, value=0.0, step=0.1, label="Temperature")
|
| 113 |
gr.ChatInterface(respond, additional_inputs=[mt, tp], examples=[[e] for e in EXAMPLES], cache_examples=False)
|
| 114 |
-
# ──
|
| 115 |
-
gr.HTML('<div
|
|
|
|
| 116 |
gr.HTML(KPI)
|
|
|
|
|
|
|
|
|
|
| 117 |
with gr.Row():
|
| 118 |
gr.Image("assets/fig_overall.png", show_label=False, container=False)
|
| 119 |
gr.Image("assets/fig_domains.png", show_label=False, container=False)
|
|
|
|
| 120 |
gr.HTML(APPROACH)
|
|
|
|
| 121 |
gr.Image("assets/fig_data.png", show_label=False, container=False)
|
| 122 |
gr.HTML(FINDING)
|
| 123 |
gr.HTML(FOOT)
|
|
|
|
| 67 |
HERO = """<div id="hero"><div class="in">
|
| 68 |
<h1>اردو <span class="a">Education & Reasoning</span></h1>
|
| 69 |
<p>A Gemma-3-4B model adapted to Urdu by translating English knowledge corpora into Urdu with
|
| 70 |
+
<b>Adaption AutoScientist</b>, then benchmarked on UrduMMLU.</p>
|
| 71 |
<div class="badges"><span class="b">Gemma-3-4B</span><span class="b">Adaption AutoScientist</span>
|
| 72 |
<span class="b">UrduMMLU 46.2%</span><span class="b">+1.3 vs base</span></div></div></div>"""
|
| 73 |
|
|
|
|
| 76 |
<div class="c"><div class="v">+3.6</div><div class="l">Profession</div></div>
|
| 77 |
<div class="c"><div class="v">+2.7</div><div class="l">Social Sci.</div></div>
|
| 78 |
<div class="c"><div class="v">46.2%</div><div class="l">UrduMMLU overall</div></div>
|
| 79 |
+
<div class="c"><div class="v">+1.3</div><div class="l">vs base overall</div></div></div>"""
|
| 80 |
|
| 81 |
+
VALIDATED = """<div class="sec"><h2>What this validates</h2>
|
| 82 |
+
<p>We tested whether adapting English knowledge corpora into Urdu with Adaption AutoScientist improves a 4B
|
| 83 |
+
model on a native Urdu benchmark. It does, for knowledge that is language-independent: every such domain
|
| 84 |
+
improved and the model exceeded its base overall (44.96% to 46.21%). The effect does not extend to Urdu
|
| 85 |
+
literature, which is intrinsic to the language and requires native data rather than translation.</p></div>"""
|
|
|
|
| 86 |
|
| 87 |
+
APPROACH = """<div class="sec"><h2>Method</h2>
|
| 88 |
+
<p>Most UrduMMLU subjects test knowledge that is largely language-independent: science, mathematics,
|
| 89 |
+
reasoning, and social studies. We assembled about 40,000 examples from open English datasets covering these
|
| 90 |
+
subjects, together with native-Urdu instruction and literature data, then used <b>Adaption AutoScientist</b>
|
| 91 |
+
and the <b>Adaptive Data</b> pipeline to translate and localise each example into Pakistani Urdu, adding a
|
| 92 |
+
reformulated prompt and an English reasoning trace. Gemma-3-4B was supervised-fine-tuned on the result and
|
| 93 |
+
evaluated on UrduMMLU, zero-shot.</p></div>"""
|
| 94 |
+
|
| 95 |
+
FINDING = """<div class="note"><b>Boundary of the method.</b> Cross-lingual adaptation improved the science,
|
| 96 |
+
mathematics, reasoning, and social-knowledge domains, but Urdu literature declined by 2.5 points. That
|
| 97 |
+
content cannot be produced by translating English sources; improving it requires native Urdu literary data.
|
| 98 |
+
This is a limitation of available data, not of the adaptation method.</div>"""
|
| 99 |
|
| 100 |
FOOT = """<div id="foot">Model: <a href="https://huggingface.co/abdullah693/gemma-3-4b-it-urdu-edu-reasoning" target="_blank">abdullah693/gemma-3-4b-it-urdu-edu-reasoning</a>
|
| 101 |
· Adapted with <b>Adaption AutoScientist</b> · Eval: <a href="https://huggingface.co/datasets/MBZUAI/UrduMMLU" target="_blank">UrduMMLU</a> (Urdu, 0-shot)<br>
|
|
|
|
| 117 |
mt = gr.Slider(64, 512, value=256, step=32, label="Max new tokens")
|
| 118 |
tp = gr.Slider(0.0, 1.0, value=0.0, step=0.1, label="Temperature")
|
| 119 |
gr.ChatInterface(respond, additional_inputs=[mt, tp], examples=[[e] for e in EXAMPLES], cache_examples=False)
|
| 120 |
+
# ── what we validated ──
|
| 121 |
+
gr.HTML('<div style="margin-top:18px"></div>')
|
| 122 |
+
gr.HTML(VALIDATED)
|
| 123 |
gr.HTML(KPI)
|
| 124 |
+
gr.Image("assets/fig_validated.png", show_label=False, container=False)
|
| 125 |
+
# ── results ──
|
| 126 |
+
gr.HTML('<div class="sec" style="margin-top:6px"><h2>Results on UrduMMLU</h2></div>')
|
| 127 |
with gr.Row():
|
| 128 |
gr.Image("assets/fig_overall.png", show_label=False, container=False)
|
| 129 |
gr.Image("assets/fig_domains.png", show_label=False, container=False)
|
| 130 |
+
# ── method ──
|
| 131 |
gr.HTML(APPROACH)
|
| 132 |
+
gr.Image("assets/fig_pipeline.png", show_label=False, container=False)
|
| 133 |
gr.Image("assets/fig_data.png", show_label=False, container=False)
|
| 134 |
gr.HTML(FINDING)
|
| 135 |
gr.HTML(FOOT)
|
assets/fig_data.png
CHANGED
|
|
assets/fig_domains.png
CHANGED
|
|
assets/fig_overall.png
CHANGED
|
|
assets/fig_pipeline.png
ADDED
|
assets/fig_validated.png
ADDED
|