amkyawdev commited on
Commit
723f202
Β·
verified Β·
1 Parent(s): a14c2d1
Files changed (3) hide show
  1. annotation_guidelines.md +48 -0
  2. api_reference.md +127 -0
  3. model_card.md +95 -0
annotation_guidelines.md ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # πŸ‡²πŸ‡² α€‘α€Šα€½α€Ύα€”α€Ία€Έα€žα€α€Ία€™α€Ύα€α€Ία€›α€”α€Ί α€œα€™α€Ία€Έα€Šα€½α€Ύα€”α€Ία€α€»α€€α€Ί
2
+
3
+ ## α€‘α€Šα€½α€Ύα€”α€Ία€Έ Label များ
4
+
5
+ ### 1. Positive (α€‘α€•α€Όα€―α€žα€˜α€±α€¬) βœ…
6
+ - **α€œα€€α€Ήα€α€α€¬**: α€›α€­α€―α€Έα€žα€¬α€Έα€žα€±α€¬ α€€α€»α€±α€Έα€‡α€°α€Έα€α€„α€Ία€™α€Ύα€―αŠ α€™α€„α€Ία€Ήα€‚α€œα€¬
7
+ - **α€₯ပမာ**:
8
+ - "ကျေးဇူးပါ"
9
+ - "α€‘α€›α€™α€Ία€Έα€€α€»α€±α€Έα€‡α€°α€Έα€α€„α€Ία€•α€«α€α€šα€Ί"
10
+ - "α€™α€„α€Ία€Ήα€‚α€œα€¬α€•α€«"
11
+
12
+ ### 2. Negative (α€‘α€”α€Ύα€―α€α€Ία€žα€˜α€±α€¬) ❌
13
+ - **α€œα€€α€Ήα€α€α€¬**: α€™α€€α€»α€±α€”α€•α€Ία€α€Όα€„α€Ία€ΈαŠ α€’α€±α€«α€žαŠ တင်းမာမှု
14
+ - **α€₯ပမာ**:
15
+ - "ကျေးဇူးပါ" (α€žα€›α€±α€¬α€Ία€žα€Šα€Ία€–α€Όα€…α€Ία€”α€­α€―α€„α€Ί)
16
+ - "α€˜α€¬α€€α€Όα€±α€¬α€„α€·α€Ία€œα€Šα€Ία€Έα€™α€žα€­"
17
+
18
+ ### 3. Neutral (α€‘α€œα€šα€Ία€‘α€œα€α€Ί) βž–
19
+ - **α€œα€€α€Ήα€α€α€¬**: α€žα€α€„α€Ία€Έα€‘α€α€»α€€α€Ία€‘α€œα€€α€Ία€žα€¬α€–α€Όα€…α€Ί
20
+ - **α€₯ပမာ**:
21
+ - "ကျေးဇူးပါ" (α€›α€­α€―α€Έα€›α€Ύα€„α€Ία€Έα€…α€½α€¬α€•α€Όα€±α€¬α€žα€Šα€Ί)
22
+
23
+ ### 4. Sarcastic (α€žα€›α€±α€¬α€Ία€α€Όα€„α€Ία€Έ) 🀨
24
+ - **α€œα€€α€Ήα€α€α€¬**: α€‘α€“α€­α€•α€Ήα€•α€«α€šα€Ία€€α€½α€±α€·αŠ α€žα€›α€±α€¬α€Ία€α€Όα€„α€Ία€Έ
25
+ - **α€₯ပမာ**:
26
+ - "ကျေးဇူးပါဗျာ" (α€‘α€”α€­α€―α€„α€Ία€šα€Ύα€‰α€Ία€Έα€žα€Šα€Ί)
27
+
28
+ ## Intensity (ထားပြိုင်မှု)
29
+
30
+ | Level | Score | Description |
31
+ |-------|-------|-------------|
32
+ | Very Low | 0.1-0.2 | α€‘α€¬α€Έα€”α€Šα€Ία€Έα€žα€±α€¬ ဆိုင်းငဢ့ |
33
+ | Low | 0.3-0.4 | ပုဢမှန် |
34
+ | Medium | 0.5-0.6 | ပြင်းပြ |
35
+ | High | 0.7-0.8 | α€‘α€œα€½α€”α€Ία€•α€Όα€„α€Ία€Έ |
36
+ | Very High | 0.9-1.0 | ထထူးပြင်း |
37
+
38
+ ## Prosody (α€‘α€žα€Ά) ဂရုစိုက်ရန်
39
+
40
+ - **Pitch (α€‘α€žα€Άα€‘α€”α€­α€™α€·α€Ία€‘α€™α€Όα€„α€·α€Ί)**: မြင့် = α€…α€­α€α€Ία€œα€Ύα€―α€•α€Ία€›α€Ύα€¬α€ΈαŠ α€”α€­α€™α€·α€Ί = α€„α€Όα€­α€™α€·α€Ία€Šα€±α€¬
41
+ - **Speed (ထမြန်နှုန်း)**: α€™α€Όα€”α€Ί = α€α€„α€Ία€Έα€™α€¬αŠ α€”α€Ύα€±α€Έ = ပျော်ပါ
42
+ - **Pause (နားချိန်)**: α€›α€Ύα€Šα€Ί = α€…α€‰α€Ία€Έα€…α€¬α€ΈαŠ α€™α€›α€Ύα€­ = α€‘α€œα€­α€―α€œα€­α€―α€žα€±α€¬
43
+
44
+ ## မှတ်စု
45
+
46
+ 1. Text နှင့် Audio prosody α€”α€Ύα€…α€Ία€α€―α€œα€―α€Άα€Έα€€α€­α€― α€€α€Όα€Šα€·α€Ία€•α€«
47
+ 2. Context α€€α€­α€― α€žα€α€­α€•α€Όα€―α€•α€« (ထရင်စကားပြောချက်)
48
+ 3. α€žα€Άα€žα€šα€–α€Όα€…α€Ία€•α€«α€€ "Confidence" နိမ့်စွာ α€žα€α€Ία€™α€Ύα€α€Ία€•α€«
api_reference.md ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # API Reference
2
+
3
+ ## FastAPI Endpoints
4
+
5
+ ### Health Check
6
+ ```
7
+ GET /health
8
+ ```
9
+ Response:
10
+ ```json
11
+ {
12
+ "status": "healthy",
13
+ "model_loaded": true
14
+ }
15
+ ```
16
+
17
+ ### Predict Sentiment
18
+ ```
19
+ POST /predict
20
+ ```
21
+ Request:
22
+ ```json
23
+ {
24
+ "text": "ကျေးဇူးပါ",
25
+ "include_prosody": false
26
+ }
27
+ ```
28
+ Response:
29
+ ```json
30
+ {
31
+ "text": "ကျေးဇူးပါ",
32
+ "sentiment": "positive",
33
+ "confidence": 0.95,
34
+ "probabilities": {
35
+ "negative": 0.01,
36
+ "neutral": 0.02,
37
+ "positive": 0.95,
38
+ "sarcastic": 0.02
39
+ }
40
+ }
41
+ ```
42
+
43
+ ### Batch Predict
44
+ ```
45
+ POST /predict_batch
46
+ ```
47
+ Request:
48
+ ```json
49
+ {
50
+ "texts": ["ကျေးဇူးပါ", "မကျေနပ်ပါဗျ"]
51
+ }
52
+ ```
53
+
54
+ ## Python SDK
55
+
56
+ ### Installation
57
+ ```bash
58
+ pip install myanmar-ghost
59
+ ```
60
+
61
+ ### Usage
62
+ ```python
63
+ from myanmar_ghost import MyanmarGhost
64
+
65
+ # Initialize
66
+ model = MyanmarGhost()
67
+
68
+ # Predict
69
+ result = model.predict("ကျေးဇူးပါ")
70
+ print(result.sentiment) # "positive"
71
+
72
+ # Batch predict
73
+ results = model.predict_batch([
74
+ "ကျေးဇူးပါ",
75
+ "မကျေနပ်ပါ"
76
+ ])
77
+ ```
78
+
79
+ ### Advanced Usage
80
+
81
+ #### XAI Explanations
82
+ ```python
83
+ from myanmar_ghost.xai import SHAPExplainer
84
+
85
+ explainer = SHAPExplainer(model)
86
+ shap_values = explainer.explain("ကျေးဇူးပါ")
87
+ explainer.visualize(shap_values)
88
+ ```
89
+
90
+ #### Active Learning
91
+ ```python
92
+ from myanmar_ghost.active_learning import UncertaintySampler
93
+
94
+ sampler = UncertaintySampler(model)
95
+ selected = sampler.select_samples(unlabeled_data, n_samples=100)
96
+ ```
97
+
98
+ ## CLI Commands
99
+
100
+ ```bash
101
+ # Train model
102
+ python -m src.models.train --train_data data/train.csv --output_dir outputs/models
103
+
104
+ # Evaluate model
105
+ python -m src.models.evaluate --model_path outputs/models/best_model.pt --data_path data/test.csv
106
+
107
+ # Deploy
108
+ bash scripts/deploy_model.sh outputs/models/best_model.pt
109
+ ```
110
+
111
+ ## Configuration
112
+
113
+ ### Environment Variables
114
+ | Variable | Description | Default |
115
+ |----------|-------------|---------|
116
+ | MODEL_PATH | Path to model files | outputs/models |
117
+ | HF_TOKEN | HuggingFace token | None |
118
+ | DEVICE | cuda or cpu | cuda |
119
+
120
+ ### Model Config
121
+ ```yaml
122
+ model:
123
+ name: myanmar_ghost
124
+ hidden_size: 768
125
+ num_layers: 12
126
+ dropout: 0.1
127
+ ```
model_card.md ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Myanmar Ghost Model Card
2
+
3
+ ## 🏷️ Model Overview
4
+
5
+ **Model Name**: Myanmar-Ghost-Instruct
6
+ **Model Type**: Text Classification (Sentiment Analysis)
7
+ **Language**: Myanmar (Burmese)
8
+ **Version**: 1.0.0
9
+ **Last Updated**: 2025
10
+
11
+ ## πŸ“Š Model Description
12
+
13
+ Myanmar Ghost is an advanced sentiment analysis model for Myanmar language that classifies text into 4 sentiment categories with multi-modal capability (audio + text).
14
+
15
+ ### Capabilities
16
+ - Myanmar text sentiment classification
17
+ - Multi-modal fusion (audio prosody + text)
18
+ - Explainable AI (SHAP, LIME)
19
+ - Privacy-preserving (Federated Learning ready)
20
+
21
+ ### Limitations
22
+ - Best performance on formal Myanmar text
23
+ - May struggle with heavy use of emoji/emoticons
24
+ - Limited performance on code-mixed text
25
+
26
+ ## πŸ“ˆ Training Data
27
+
28
+ - **Source**: Myanmar speech datasets
29
+ - **Size**: ~1M samples
30
+ - **Splits**: 80% train, 10% validation, 10% test
31
+
32
+ ## βš™οΈ Model Architecture
33
+
34
+ ```
35
+ Transformer (BERT-based multilingual)
36
+ β”œβ”€β”€ Hidden Size: 768
37
+ β”œβ”€β”€ Layers: 12
38
+ β”œβ”€β”€ Heads: 12
39
+ └── Classifier Head
40
+ └── 4-class output (negative, neutral, positive, sarcastic)
41
+ ```
42
+
43
+ ## πŸ“‰ Performance
44
+
45
+ | Metric | Score |
46
+ |--------|-------|
47
+ | Accuracy | ~92% |
48
+ | F1 (weighted) | ~91% |
49
+ | F1 (macro) | ~89% |
50
+ | Precision | ~91% |
51
+ | Recall | ~91% |
52
+
53
+ ## πŸ”§ Usage
54
+
55
+ ### Python
56
+ ```python
57
+ from transformers import AutoModelForSequenceClassification, AutoTokenizer
58
+
59
+ model_name = "amkyawdev/Myanmar-Ghost-Instruct"
60
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
61
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
62
+
63
+ # Predict
64
+ text = "ကျေးဇူးပါ"
65
+ inputs = tokenizer(text, return_tensors="pt")
66
+ outputs = model(**inputs)
67
+ ```
68
+
69
+ ### API
70
+ ```bash
71
+ curl -X POST http://localhost:8000/predict \
72
+ -H "Content-Type: application/json" \
73
+ -d '{"text": "ကျေးဇူးပါ"}'
74
+ ```
75
+
76
+ ## ⚠️ Ethical Considerations
77
+
78
+ - Model trained on publicly available Myanmar data
79
+ - No personally identifiable information used
80
+ - Regular evaluation for bias
81
+
82
+ ## πŸ“ Citation
83
+
84
+ ```
85
+ @software{myanmar_ghost,
86
+ title = {Myanmar Ghost},
87
+ author = {Aung Myo Kyaw},
88
+ url = {https://huggingface.co/amkyawdev/Myanmar-Ghost-Instruct},
89
+ year = {2025},
90
+ }
91
+ ```
92
+
93
+ ## 🀝 License
94
+
95
+ Apache 2.0