Text Generation
Transformers
Burmese
English
myanmar
burmese
llm
chat
instruction-following
conversational
autoregressive
Instructions to use amkyawdev/myanmar-ghost with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amkyawdev/myanmar-ghost with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="amkyawdev/myanmar-ghost") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("amkyawdev/myanmar-ghost", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use amkyawdev/myanmar-ghost with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "amkyawdev/myanmar-ghost" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amkyawdev/myanmar-ghost", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/amkyawdev/myanmar-ghost
- SGLang
How to use amkyawdev/myanmar-ghost with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "amkyawdev/myanmar-ghost" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amkyawdev/myanmar-ghost", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "amkyawdev/myanmar-ghost" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "amkyawdev/myanmar-ghost", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use amkyawdev/myanmar-ghost with Docker Model Runner:
docker model run hf.co/amkyawdev/myanmar-ghost
Add docs
Browse files- annotation_guidelines.md +48 -0
- api_reference.md +127 -0
- 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
|