amkyawdev commited on
Commit
2c4fdf7
·
verified ·
1 Parent(s): bf8fbca

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -1,49 +1,56 @@
1
- # Amkyaw-Core-L3
2
-
3
- A high-quality 3-step reasoning dataset for training AI models on systematic thinking processes.
4
-
5
- ## Dataset Description
6
-
7
- Amkyaw-Core-L3 is a reasoning-focused dataset designed to train AI models on 3-step thinking processes:
8
- 1. Problem understanding
9
- 2. Solution derivation
10
- 3. Verification
11
-
12
- ## Structure
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  ```
15
  Amkyaw-Core-L3/
 
16
  ├── data/
 
17
  │ ├── brain/
18
- │ │ ├── reasoning_steps.jsonl # Main reasoning data
19
- │ │ ├── conversations.jsonl # User-Model dialogues
20
- │ │ └── metadata.json # Training data metadata
21
- ── validation/
22
- └── validation.jsonl # Validation data
23
- │ └── raw_logs/
24
- │ └── logs-*.jsonl # Raw logs from Gradio Space
25
  ├── scripts/
26
- ── preprocess.py
27
- │ ├── validate_data.py
28
- │ ├── push_to_hub.py
29
- │ └── augment_reasoning.py
30
  └── configs/
31
- ── dataset_config.yaml
32
- └── reasoning_prompts.yaml
33
  ```
34
 
35
  ## Usage
36
 
37
  ```python
38
  from datasets import load_dataset
39
-
40
  dataset = load_dataset("amkyawdev/Amkyaw-Core-L3")
41
  ```
42
 
43
  ## License
44
 
45
- MIT License
46
-
47
- ## Citation
48
-
49
- Please cite this dataset if used in research.
 
1
+ ---
2
+ title: Amkyaw Core L3
3
+ emoji: 🧠
4
+ colorFrom: yellow
5
+ colorTo: purple
6
+ sdk: gradio
7
+ sdk_version: 6.12.0
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
11
+ short_description: '3-Step Reasoning Chat System'
12
+ tags:
13
+ - chat
14
+ - reasoning
15
+ - gradio
16
+ - burmese
17
+ ---
18
+
19
+ # 🧠 Amkyaw Core L3 - ၃ ဆင့်တွေးခေါ်မှု System
20
+
21
+ This is a 3-step reasoning system that uses keyword matching to provide structured responses.
22
+
23
+ ## Features
24
+ - Step 1: Perception (အခြေအနေ ပိုင်းခြား)
25
+ - Step 2: Logical Sequence (ယုတ္တိအစဉ်)
26
+ - Step 3: Verification & Output (အတည်ပြု + အဖြေထုတ်)
27
+
28
+ ## Dataset Structure
29
 
30
  ```
31
  Amkyaw-Core-L3/
32
+ ├── app.py # Gradio app
33
  ├── data/
34
+ │ ├── responses.jsonl # Response data
35
  │ ├── brain/
36
+ │ │ ├── reasoning_steps.jsonl
37
+ │ │ ├── conversations.jsonl
38
+ │ │ └── metadata.json
39
+ ── validation/
40
+ └── validation.jsonl
 
 
41
  ├── scripts/
42
+ ── *.py
 
 
 
43
  └── configs/
44
+ ── *.yaml
 
45
  ```
46
 
47
  ## Usage
48
 
49
  ```python
50
  from datasets import load_dataset
 
51
  dataset = load_dataset("amkyawdev/Amkyaw-Core-L3")
52
  ```
53
 
54
  ## License
55
 
56
+ MIT License
 
 
 
 
app.py ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import gradio as gr
3
+ from difflib import SequenceMatcher
4
+ from pathlib import Path
5
+
6
+
7
+ # JSONL ဖိုင်ကို တစ်ခါဖတ်ပြီး memory ထဲထား
8
+ DATA_PATH = Path(__file__).parent / "data" / "responses.jsonl"
9
+
10
+
11
+ with open(DATA_PATH, "r", encoding="utf-8") as f:
12
+ responses = [json.loads(line) for line in f]
13
+
14
+
15
+ def three_step_reasoning(user_message, history):
16
+ """
17
+ သုံးဆင့်တွေးခေါ်မှု System
18
+ Step 1: Perception (အခြေအနေ ပိုင်းခြား)
19
+ Step 2: Logical Sequence (ယုတ္တိအစဉ်)
20
+ Step 3: Verification & Output (အတည်ပြု + အဖြေထုတ်)
21
+ """
22
+
23
+ # ----- အဆင့် ၁: Perception (ဖမ်းယူခြင်း) -----
24
+ print(f"[Step 1 - Perception] User: {user_message}")
25
+
26
+ # JSONL ထဲက အကောင်းဆုံး match ကို ရှာ
27
+ best_match = None
28
+ best_score = 0
29
+
30
+ for resp in responses:
31
+ score = 0
32
+ for kw in resp["keywords"]:
33
+ if kw in user_message:
34
+ # keyword တစ်လုံးချင်းစီအတွက် အချိုးကျပုံ
35
+ score += SequenceMatcher(None, user_message, kw).ratio()
36
+
37
+ # စုစုပေါင်း score ကို keyword အရေအတွက်နဲ့ စား
38
+ if resp["keywords"]:
39
+ score = score / len(resp["keywords"])
40
+
41
+ if score > best_score:
42
+ best_score = score
43
+ best_match = resp
44
+
45
+ # ----- အဆင့် ၂: Logical Sequence (ယုတ္တိအစဉ်တန်း) -----
46
+ if best_match and best_score > 0.3: # threshold 0.3
47
+ print(f"[Step 2 - Logical Sequence] Matched: {best_match['keywords']} (score: {best_score:.2f})")
48
+ reasoning = best_match["step2"]
49
+ else:
50
+ print(f"[Step 2 - Logical Sequence] No good match found")
51
+ reasoning = "ကျေးဇူးပြု၍ ပိုရှင်းလင်းအောင် မေးပေးပါ။"
52
+
53
+ # ----- အဆင့် ၃: Verification & Output (အတည်ပြု + အဖြေထုတ်) -----
54
+ if best_match and best_score > 0.3:
55
+ print(f"[Step 3 - Verification] {best_match['step3']}")
56
+ print(f"[Step 3 - Output] {best_match['answer']}")
57
+
58
+ final_output = f"""🧠 **အဆင့် ၁ - Perception (ခံယူချက်)**
59
+ {best_match['step1']}
60
+
61
+
62
+ ⚙️ **အဆင့် ၂ - Logical Sequence (ယုတ္တိအစဉ်)**
63
+ {reasoning}
64
+
65
+
66
+ ✅ **အဆင့် ၃ - Verification & Output (အတည်ပြုခြင်းနှင့် အဖြေ)**
67
+ {best_match['step3']}
68
+
69
+
70
+ ---
71
+ ✨ **အဖြေ:** {best_match['answer']}"""
72
+ else:
73
+ final_output = f"""🧠 **အဆင့် ၁ - Perception (ခံယူချက်)**
74
+ မေးခွန်းကို နားလည်ရန် ကြိုးစားနေပါတယ်။
75
+
76
+
77
+ ⚙️ **အဆင့် ၂ - Logical Sequence (ယုတ္တိအစဉ်)**
78
+ {reasoning}
79
+
80
+
81
+ ✅ **အဆင့် ၃ - Verification & Output (အတည်ပြုခြင်းနှင့် အဖြေ)**
82
+ ကျေးဇူးပြု၍ ထပ်မေးပေးပါ။"""
83
+
84
+
85
+ return final_output
86
+
87
+
88
+ # Gradio Interface
89
+ demo = gr.ChatInterface(
90
+ fn=three_step_reasoning,
91
+ title="🧠 Amkyaw Core L3 - ၃ ဆင့်တွေးခေါ်မှု System",
92
+ description="3-Step Reasoning System with keyword matching",
93
+ theme=gr.themes.Soft(),
94
+ )
95
+
96
+ # Launch
97
+ demo.launch()
configs/dataset_config.yaml CHANGED
@@ -1,24 +1,3 @@
1
- dataset_name: Amkyaw-Core-L3
2
- version: "1.0.0"
3
- description: 3-step reasoning dataset for AI training
4
-
5
- # Data configuration
6
- data:
7
- brain:
8
- reasoning_steps: data/brain/reasoning_steps.jsonl
9
- conversations: data/brain/conversations.jsonl
10
- metadata: data/brain/metadata.json
11
- validation:
12
- path: data/validation/validation.jsonl
13
-
14
- # Processing
15
- processing:
16
- num_reasoning_steps: 3
17
- languages:
18
- - en
19
- tasks:
20
- - reasoning
21
- - math
22
-
23
- # License
24
- license: MIT
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d30d311ed796982363e60062c52adb741042fa5f42185188506c8e410f430f1c
3
+ size 469
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
configs/reasoning_prompts.yaml CHANGED
@@ -1,42 +1,3 @@
1
- # 3-Step Reasoning Prompt Templates
2
-
3
- templates:
4
- step1:
5
- name: "Problem Understanding"
6
- description: "Break down and understand the problem"
7
- prompt: |
8
- Step 1: Understand the problem
9
- - Identify what is being asked
10
- - Determine the operation needed
11
- - Extract relevant numbers
12
-
13
- step2:
14
- name: "Solution Derivation"
15
- description: "Apply the operation to find the answer"
16
- prompt: |
17
- Step 2: Derive the solution
18
- - Apply the operation step by step
19
- - Show intermediate calculations
20
- - Get the final result
21
-
22
- step3:
23
- name: "Verification"
24
- description: "Verify the answer is correct"
25
- prompt: |
26
- Step 3: Verify
27
- - Check by doing the reverse operation
28
- - Confirm the answer makes sense
29
-
30
- # Example prompts
31
- examples:
32
- math_add: |
33
- Let me solve this step by step:
34
- Step 1: Add {a} + {b}
35
- Step 2: Compute the sum
36
- Step 3: Verify by subtracting
37
-
38
- math_multiply: |
39
- Let me solve this step by step:
40
- Step 1: Break down the problem
41
- Step 2: Multiply step by step
42
- Step 3: Verify by dividing
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b54cc18534c55c4fb06240a1e9f2b54ad562e6801841e8b14efda6c958ce86b
3
+ size 1089
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/brain/conversations.jsonl CHANGED
@@ -1,3 +1,3 @@
1
- {"user": "What is 15 + 27?", "assistant": "Let me solve this step by step:\n\nStep 1: Add 15 + 20 = 35\nStep 2: Add 35 + 7 = 42\nStep 3: Verify: 42 - 27 = 15 ✓\n\nAnswer: 42"}
2
- {"user": "What is 8 × 6?", "assistant": "Let me solve this step by step:\n\nStep 1: Break 6 into 2 × 3: 8 × 2 = 16\nStep 2: Multiply 16 × 3 = 48\nStep 3: Verify: 48 ÷ 6 = 8 ✓\n\nAnswer: 48"}
3
- {"user": "What is 100 - 37?", "assistant": "Let me solve this step by step:\n\nStep 1: Subtract 100 - 30 = 70\nStep 2: Subtract 70 - 7 = 63\nStep 3: Verify: 63 + 37 = 100 ✓\n\nAnswer: 63"}
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b7117aed582e7a34fb64856ef52eb3b747a64eb4b23a8a678b7eeeb5f919bf1b
3
+ size 566
data/brain/metadata.json CHANGED
@@ -1,10 +1,3 @@
1
- {
2
- "dataset_name": "Amkyaw-Core-L3",
3
- "version": "1.0.0",
4
- "description": "3-step reasoning training data",
5
- "num_samples": 3,
6
- "languages": ["en"],
7
- "tasks": ["reasoning", "math"],
8
- "created_date": "2026-04-14",
9
- "license": "MIT"
10
- }
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8f75ceedf58a80e225bd3181014b52cd0370f192c69bc35bb5e53ff854f53e2d
3
+ size 240
 
 
 
 
 
 
 
data/brain/reasoning_steps.jsonl CHANGED
@@ -1,3 +1,3 @@
1
- {"id": "reasoning_001", "problem": "What is 15 + 27?", "steps": [{"step": 1, "description": "Add 15 + 20", "result": "35"}, {"step": 2, "description": "Add 35 + 7", "result": "42"}, {"step": 3, "description": "Verify 42 - 27 = 15", "result": "15 ✓"}], "final_answer": "42"}
2
- {"id": "reasoning_002", "problem": "What is 8 × 6?", "steps": [{"step": 1, "description": "Break 6 into 2 × 3", "result": "8 × 2 = 16"}, {"step": 2, "description": "Multiply 16 × 3", "result": "48"}, {"step": 3, "description": "Verify 48 ÷ 6 = 8", "result": "8 ✓"}], "final_answer": "48"}
3
- {"id": "reasoning_003", "problem": "What is 100 - 37?", "steps": [{"step": 1, "description": "Subtract 100 - 30", "result": "70"}, {"step": 2, "description": "Subtract 70 - 7", "result": "63"}, {"step": 3, "description": "Verify 63 + 37 = 100", "result": "100 ✓"}], "final_answer": "63"}
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73e01c6d31d16d2206ba3f9092befa65dac2128910277d13bc9d657d23a3c28f
3
+ size 861
data/responses.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5ef90a3b83d746c34f77fb805738b88c482aa3e6654c04aa61d00a6431cb541
3
+ size 2107
data/validation/validation.jsonl CHANGED
@@ -1 +1,3 @@
1
- {"id": "val_001", "problem": "What is 25 + 18?", "steps": [{"step": 1, "description": "Add 25 + 10", "result": "35"}, {"step": 2, "description": "Add 35 + 8", "result": "43"}, {"step": 3, "description": "Verify 43 - 18 = 25", "result": "25 ✓"}], "final_answer": "43"}
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70733a9aebbe45683042ba6895ea9acede5644693ce6a5aac0608bd3e507669c
3
+ size 269