File size: 6,286 Bytes
7b960f1
 
9648a2b
8cb9c5e
7b960f1
 
f087a3c
7b960f1
 
 
 
 
 
f068422
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4a14c80
f068422
4a14c80
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
---
title: Archon AI
emoji: πŸͺ™
colorFrom: blue
colorTo: gray
sdk: gradio
sdk_version: 6.4.0
app_file: app.py
pinned: false
license: apache-2.0
short_description: 'Archon: Professional Financial Resilience Engine'
---

<div align="center">

# πŸͺ™ ARCHON-AI

### Professional Financial Resilience Engine

[![Gradio](https://img.shields.io/badge/Built%20with-Gradio-orange?logo=gradio)](https://gradio.app/)
[![Python](https://img.shields.io/badge/Python-3.8+-blue?logo=python)](https://python.org)
[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)
[![HuggingFace Spaces](https://img.shields.io/badge/πŸ€—-Hugging%20Face%20Spaces-yellow)](https://huggingface.co/spaces)

*Sistem Analisis Kesehatan Finansial Nasabah Berbasis Kecerdasan Buatan*

</div>

---

## πŸ“‹ Deskripsi

**Archon-AI** adalah aplikasi *Financial Resilience Engine* yang dirancang untuk menganalisis dan menilai kesehatan finansial nasabah secara komprehensif. Sistem ini menggunakan pendekatan multi-fase untuk memberikan insight yang akurat dan rekomendasi yang actionable bagi nasabah.

### 🎯 Fitur Utama

| Fitur | Deskripsi |
|-------|-----------|
| **πŸ” Analisis Transaksi** | Mengklasifikasikan pengeluaran menjadi *essential* vs *discretionary* |
| **πŸ“Š Risk Scoring** | Menghitung skor risiko finansial dengan bobot multi-faktor |
| **πŸ’‘ Next Best Offer (NBO)** | Rekomendasi produk/layanan yang sesuai kondisi nasabah |
| **πŸ“ˆ Visualisasi Interaktif** | Dashboard dengan grafik arus kas, komposisi belanja, dan tren saldo |
| **πŸ“ Laporan Naratif** | Penjelasan kondisi keuangan yang mudah dipahami |

---

## πŸ—οΈ Arsitektur Sistem

Archon-AI menggunakan arsitektur 6 fase:

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        ARCHON-AI PIPELINE                       β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  FASE 1: Data Loading      β†’ Load transaksi, saldo, repayment  β”‚
β”‚  FASE 2: Intelligence      β†’ Semantic Parser untuk klasifikasi β”‚
β”‚  FASE 3: Risk Calculation  β†’ Hitung expense ratio, trend saldo β”‚
β”‚  FASE 4: Risk Scoring      β†’ Bobot 30/20/20/20/10              β”‚
β”‚  FASE 5: NBO Engine        β†’ Generate rekomendasi produk       β”‚
β”‚  FASE 6: Explainable AI    β†’ Narrative summary generation      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

### πŸ“Š Komponen Risk Scoring

| Komponen | Bobot | Deskripsi |
|----------|-------|-----------|
| Expense Ratio | 30% | Rasio pengeluaran terhadap pendapatan |
| Balance Trend | 20% | Tren pertumbuhan/penurunan saldo |
| Overdraft History | 20% | Riwayat saldo negatif |
| Missed Payments | 20% | Keterlambatan pembayaran cicilan |
| Base Score | 10% | Skor dasar |

---

## πŸ› οΈ Teknologi

- **Frontend**: [Gradio](https://gradio.app/) - UI Framework
- **Data Processing**: [Pandas](https://pandas.pydata.org/), [NumPy](https://numpy.org/)
- **Visualization**: [Plotly](https://plotly.com/)
- **AI Integration**: [Google GenAI](https://ai.google.dev/)
- **Deep Learning**: [PyTorch](https://pytorch.org/), [Transformers](https://huggingface.co/transformers/)

---

## πŸ“¦ Instalasi

### Prasyarat

- Python 3.8 atau lebih tinggi
- pip (Python package manager)

### Langkah Instalasi

1. **Clone repository**
   ```bash
   git clone https://github.com/username/Archon-AI.git
   cd Archon-AI
   ```

2. **Buat virtual environment** (opsional tapi disarankan)
   ```bash
   python -m venv venv
   
   # Windows
   venv\Scripts\activate
   
   # Linux/macOS
   source venv/bin/activate
   ```

3. **Install dependencies**
   ```bash
   pip install -r requirements.txt
   ```

4. **Setup environment variable**
   ```bash
   # Buat file .env
   GOOGLE_API_KEY=your_api_key_here
   ```

---

## πŸš€ Menjalankan Aplikasi

```bash
python app.py
```

Aplikasi akan berjalan di `http://localhost:7860`

---

## πŸ“‚ Struktur Project

```
Archon-AI/
β”œβ”€β”€ πŸ“„ app.py                    # Aplikasi utama Gradio
β”œβ”€β”€ πŸ“„ requirements.txt          # Dependencies Python
β”œβ”€β”€ πŸ““ Archon_Development.ipynb  # Notebook development & training
β”œβ”€β”€ πŸ“„ .env                      # Environment variables
β”‚
β”œβ”€β”€ πŸ“ archon_v1/                # Model yang telah di-train
β”‚   β”œβ”€β”€ πŸ“„ config.json
β”‚   β”œβ”€β”€ πŸ“„ model.safetensors
β”‚   β”œβ”€β”€ πŸ“„ tokenizer.json
β”‚   β”œβ”€β”€ πŸ“„ tokenizer_config.json
β”‚   └── πŸ“„ vocab.txt
β”‚
└── πŸ“Š Data Files/
    β”œβ”€β”€ πŸ“„ transactions.csv      # Data transaksi nasabah
    β”œβ”€β”€ πŸ“„ customers.csv         # Data profil nasabah
    β”œβ”€β”€ πŸ“„ balances_revised.csv  # Data saldo bulanan
    β”œβ”€β”€ πŸ“„ repayments_revised.csv # Data pembayaran cicilan
    └── πŸ“„ offers.csv            # Data penawaran produk
```

---

## πŸ“– Cara Penggunaan

1. **Buka aplikasi** di browser
2. **Masukkan Customer ID** (format: C0001 - C0120)
3. **Klik tombol "ANALYZE CUSTOMER"**
4. **Lihat hasil analisis** yang mencakup:
   - Status kesehatan finansial (LOW/MEDIUM/HIGH Risk)
   - Skor risiko (0.00 - 1.00)
   - Efisiensi belanja dalam persentase
   - Rekomendasi dan langkah-langkah implementasi

---

## 🎨 Kategori Risiko

| Level | Skor | Warna | Rekomendasi |
|-------|------|-------|-------------|
| 🟒 **LOW** | < 0.4 | Hijau | Optimalkan Tabungan |
| 🟑 **MEDIUM** | 0.4 - 0.7 | Kuning | Edukasi Pengelolaan Kas |
| πŸ”΄ **HIGH** | β‰₯ 0.7 | Merah | Program Restrukturisasi |

---

## 🀝 Kontribusi

Kontribusi sangat diterima! Silakan:

1. Fork repository ini
2. Buat branch fitur (`git checkout -b feature/AmazingFeature`)
3. Commit perubahan (`git commit -m 'Add some AmazingFeature'`)
4. Push ke branch (`git push origin feature/AmazingFeature`)
5. Buka Pull Request

---

## Lisensi

Apache 2.0.