OPTEMA AI
This commit is contained in:
parent
60f601a85b
commit
0ab3040f29
Binary file not shown.
Binary file not shown.
@ -15,7 +15,7 @@ class ProblemCaseForm(forms.ModelForm):
|
|||||||
"description": forms.Textarea(attrs={
|
"description": forms.Textarea(attrs={
|
||||||
"class": "form-control problem-textarea",
|
"class": "form-control problem-textarea",
|
||||||
"rows": 9,
|
"rows": 9,
|
||||||
"placeholder": "Contoh: Kuliah di Singapura atau Jepang, dana 200 juta, ingin 3 tahun selesai.",
|
"placeholder": "Contoh: BUMN rugi karena biaya tinggi, omzet turun 30%, atau kuliah Jepang/Singapura dengan dana 200 juta.",
|
||||||
}),
|
}),
|
||||||
"urgency": forms.TextInput(attrs={
|
"urgency": forms.TextInput(attrs={
|
||||||
"type": "range",
|
"type": "range",
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
<p class="eyebrow mb-3">Mesin Pemecah Masalah Universal & Decision Intelligence Platform</p>
|
<p class="eyebrow mb-3">Mesin Pemecah Masalah Universal & Decision Intelligence Platform</p>
|
||||||
<h1 class="display-heading mb-4">💡 OPTEMA AI</h1>
|
<h1 class="display-heading mb-4">💡 OPTEMA AI</h1>
|
||||||
<h2 class="hero-subtitle mb-3">Optimal, Effective, Efficient Management Assistant</h2>
|
<h2 class="hero-subtitle mb-3">Optimal, Effective, Efficient Management Assistant</h2>
|
||||||
<p class="hero-copy mb-4">MVP single-user tanpa login: masukkan masalah bisnis, keuangan, karier, logistik, teknologi, atau pendidikan; atur urgensi, lalu dapatkan simulasi Problem Detection, Root Cause, Decision Scoring, dan Action Plan yang tersimpan otomatis.</p>
|
<p class="hero-copy mb-4">MVP single-user tanpa login: masukkan masalah pemerintah/publik, bisnis, keuangan, karier, logistik, teknologi, atau pendidikan; atur urgensi, lalu dapatkan simulasi Problem Detection, Root Cause, Decision Scoring, dan Action Plan yang tersimpan otomatis.</p>
|
||||||
<div class="d-flex flex-wrap gap-3">
|
<div class="d-flex flex-wrap gap-3">
|
||||||
<a href="#analisis" class="btn btn-optema btn-lg">Jalankan Analisis AI</a>
|
<a href="#analisis" class="btn btn-optema btn-lg">Jalankan Analisis AI</a>
|
||||||
<a href="{% url 'case_list' %}" class="btn btn-outline-optema btn-lg">Lihat Riwayat Case</a>
|
<a href="{% url 'case_list' %}" class="btn btn-outline-optema btn-lg">Lihat Riwayat Case</a>
|
||||||
@ -70,7 +70,7 @@
|
|||||||
<span class="panel-icon">📥</span>
|
<span class="panel-icon">📥</span>
|
||||||
<div>
|
<div>
|
||||||
<h2>Input Masalah</h2>
|
<h2>Input Masalah</h2>
|
||||||
<p>Masukkan masalah, target, atau hambatan Anda. Contoh: kuliah Singapura/Jepang dengan budget terbatas.</p>
|
<p>Masukkan masalah, target, atau hambatan Anda. Contoh: BUMN rugi karena biaya tinggi, omzet toko turun, atau kuliah Singapura/Jepang dengan budget terbatas.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<form method="post" novalidate>
|
<form method="post" novalidate>
|
||||||
|
|||||||
198
core/views.py
198
core/views.py
@ -228,6 +228,7 @@ def _build_case_insights(description, category=None):
|
|||||||
countries = case_data.get("countries")
|
countries = case_data.get("countries")
|
||||||
percentages = case_data.get("percentages") or []
|
percentages = case_data.get("percentages") or []
|
||||||
detected = [
|
detected = [
|
||||||
|
{"label": "Sektor/Kategori", "value": category or "Umum", "note": "hasil deteksi keyword dari knowledge database OPTEMA"},
|
||||||
{"label": "Dana/budget", "value": _format_idr(budget) if budget else "Belum disebut", "note": "angka terbesar yang terdeteksi sebagai uang" if budget else "tambahkan nominal agar kalkulasi lebih presisi"},
|
{"label": "Dana/budget", "value": _format_idr(budget) if budget else "Belum disebut", "note": "angka terbesar yang terdeteksi sebagai uang" if budget else "tambahkan nominal agar kalkulasi lebih presisi"},
|
||||||
{"label": "Target waktu", "value": _format_years(years) if years else "Belum disebut", "note": "diambil dari kata tahun/bulan/semester" if years else "tambahkan deadline atau durasi target"},
|
{"label": "Target waktu", "value": _format_years(years) if years else "Belum disebut", "note": "diambil dari kata tahun/bulan/semester" if years else "tambahkan deadline atau durasi target"},
|
||||||
{"label": "Persentase/rasio", "value": ", ".join(f"{value:g}%" for value in percentages) if percentages else "Belum disebut", "note": "persen yang muncul di pertanyaan" if percentages else "tambahkan rasio seperti turun 30% atau target naik 20%"},
|
{"label": "Persentase/rasio", "value": ", ".join(f"{value:g}%" for value in percentages) if percentages else "Belum disebut", "note": "persen yang muncul di pertanyaan" if percentages else "tambahkan rasio seperti turun 30% atau target naik 20%"},
|
||||||
@ -271,6 +272,12 @@ def _build_case_insights(description, category=None):
|
|||||||
if best["shortfall_low"] else
|
if best["shortfall_low"] else
|
||||||
f"Opsi paling aman secara angka awal adalah {best['country']} karena estimasi minimumnya masih masuk budget."
|
f"Opsi paling aman secara angka awal adalah {best['country']} karena estimasi minimumnya masih masuk budget."
|
||||||
)
|
)
|
||||||
|
elif category and category != "Pendidikan":
|
||||||
|
category_item = next((item for item in ANALYSIS_DATABASE if item["kategori"] == category), None)
|
||||||
|
if category_item:
|
||||||
|
primary_cause = category_item["penyebab"][0]
|
||||||
|
primary_solution = category_item["solusi"][0]
|
||||||
|
recommendation = f"Sektor terdeteksi: {category}. Dengan konteks {_case_constraint_note(case_data)}, validasi dulu akar masalah utama: {primary_cause}. Prioritas solusi awal: {primary_solution}."
|
||||||
elif calculations:
|
elif calculations:
|
||||||
recommendation = f"Analisis disesuaikan dengan {_case_constraint_note(case_data)}; gunakan angka ini sebagai batas saat memilih solusi."
|
recommendation = f"Analisis disesuaikan dengan {_case_constraint_note(case_data)}; gunakan angka ini sebagai batas saat memilih solusi."
|
||||||
|
|
||||||
@ -291,6 +298,114 @@ def _build_case_insights(description, category=None):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SECTOR_DATABASE = {
|
||||||
|
"pemerintah": {
|
||||||
|
"kategori": "Pemerintah",
|
||||||
|
"keyword": [
|
||||||
|
"bumn", "kementerian", "negara", "pemerintah", "anggaran", "publik",
|
||||||
|
"dinas", "pemda", "layanan publik", "instansi",
|
||||||
|
],
|
||||||
|
"root": [
|
||||||
|
"Inefisiensi operasional",
|
||||||
|
"Pengawasan lemah",
|
||||||
|
"Tata kelola buruk",
|
||||||
|
"Beban biaya tinggi",
|
||||||
|
"Strategi tidak tepat",
|
||||||
|
],
|
||||||
|
"solution": [
|
||||||
|
"Restrukturisasi organisasi",
|
||||||
|
"Audit biaya",
|
||||||
|
"Perbaikan tata kelola",
|
||||||
|
"Digitalisasi proses",
|
||||||
|
"Evaluasi kinerja",
|
||||||
|
],
|
||||||
|
"impact_label": "Publik/anggaran",
|
||||||
|
"priority": 25,
|
||||||
|
},
|
||||||
|
"bisnis": {
|
||||||
|
"kategori": "Bisnis",
|
||||||
|
"keyword": [
|
||||||
|
"bisnis", "usaha", "jualan", "toko", "produk", "omzet",
|
||||||
|
"penjualan", "layanan", "customer", "pelanggan",
|
||||||
|
],
|
||||||
|
"root": [
|
||||||
|
"Target pasar salah",
|
||||||
|
"Marketing kurang efektif",
|
||||||
|
"Produk tidak sesuai kebutuhan",
|
||||||
|
"Biaya operasional tinggi",
|
||||||
|
],
|
||||||
|
"solution": [
|
||||||
|
"Riset pelanggan",
|
||||||
|
"Perbaikan produk",
|
||||||
|
"Optimasi pemasaran",
|
||||||
|
"Efisiensi operasional",
|
||||||
|
],
|
||||||
|
"impact_label": "Besar",
|
||||||
|
"priority": 10,
|
||||||
|
},
|
||||||
|
"keuangan": {
|
||||||
|
"kategori": "Keuangan",
|
||||||
|
"keyword": [
|
||||||
|
"uang", "hutang", "utang", "modal", "gaji", "biaya",
|
||||||
|
"cashflow", "kas", "tabungan", "budget",
|
||||||
|
],
|
||||||
|
"root": [
|
||||||
|
"Cashflow tidak sehat",
|
||||||
|
"Pengeluaran besar",
|
||||||
|
"Pemasukan rendah",
|
||||||
|
],
|
||||||
|
"solution": [
|
||||||
|
"Kontrol biaya",
|
||||||
|
"Buat anggaran",
|
||||||
|
"Tambah pendapatan",
|
||||||
|
],
|
||||||
|
"impact_label": "Cashflow/budget",
|
||||||
|
"priority": 10,
|
||||||
|
},
|
||||||
|
"teknologi": {
|
||||||
|
"kategori": "Teknologi",
|
||||||
|
"keyword": [
|
||||||
|
"aplikasi", "website", "coding", "software", "error",
|
||||||
|
"program", "bug", "sistem", "otomatisasi",
|
||||||
|
],
|
||||||
|
"root": [
|
||||||
|
"Bug sistem",
|
||||||
|
"Arsitektur kurang baik",
|
||||||
|
"Proses manual",
|
||||||
|
],
|
||||||
|
"solution": [
|
||||||
|
"Audit sistem",
|
||||||
|
"Perbaikan kode",
|
||||||
|
"Otomatisasi",
|
||||||
|
],
|
||||||
|
"impact_label": "Teknis/operasional",
|
||||||
|
"priority": 10,
|
||||||
|
},
|
||||||
|
"logistik": {
|
||||||
|
"kategori": "Logistik",
|
||||||
|
"keyword": [
|
||||||
|
"kirim", "barang", "gudang", "rute", "pengiriman",
|
||||||
|
"distribusi", "tracking", "kurir",
|
||||||
|
],
|
||||||
|
"root": [
|
||||||
|
"Rute buruk",
|
||||||
|
"Monitoring kurang",
|
||||||
|
"Distribusi lambat",
|
||||||
|
],
|
||||||
|
"solution": [
|
||||||
|
"Optimasi rute",
|
||||||
|
"Tracking real-time",
|
||||||
|
"Perbaikan SOP",
|
||||||
|
],
|
||||||
|
"impact_label": "Operasional",
|
||||||
|
"priority": 10,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for sector_data in SECTOR_DATABASE.values():
|
||||||
|
sector_data["penyebab"] = sector_data["root"]
|
||||||
|
sector_data["solusi"] = sector_data["solution"]
|
||||||
|
|
||||||
ANALYSIS_DATABASE = [
|
ANALYSIS_DATABASE = [
|
||||||
{
|
{
|
||||||
"kategori": "Pendidikan",
|
"kategori": "Pendidikan",
|
||||||
@ -312,39 +427,9 @@ ANALYSIS_DATABASE = [
|
|||||||
"impact_label": "Budget ketat",
|
"impact_label": "Budget ketat",
|
||||||
"priority": 50,
|
"priority": 50,
|
||||||
},
|
},
|
||||||
{
|
SECTOR_DATABASE["pemerintah"],
|
||||||
"kategori": "Bisnis",
|
SECTOR_DATABASE["bisnis"],
|
||||||
"keyword": ["jualan", "penjualan", "produk", "usaha", "bisnis", "toko"],
|
SECTOR_DATABASE["keuangan"],
|
||||||
"penyebab": [
|
|
||||||
"Target pasar tidak tepat",
|
|
||||||
"Promosi kurang efektif",
|
|
||||||
"Produk belum sesuai kebutuhan pasar",
|
|
||||||
],
|
|
||||||
"solusi": [
|
|
||||||
"Riset pelanggan",
|
|
||||||
"Perbaiki produk",
|
|
||||||
"Optimasi pemasaran",
|
|
||||||
"Bangun channel penjualan",
|
|
||||||
],
|
|
||||||
"impact_label": "Besar",
|
|
||||||
"priority": 10,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"kategori": "Keuangan",
|
|
||||||
"keyword": ["uang", "hutang", "utang", "gaji", "tabungan", "biaya"],
|
|
||||||
"penyebab": [
|
|
||||||
"Tidak ada kontrol keuangan",
|
|
||||||
"Pengeluaran terlalu besar",
|
|
||||||
"Pemasukan kurang optimal",
|
|
||||||
],
|
|
||||||
"solusi": [
|
|
||||||
"Buat anggaran",
|
|
||||||
"Kurangi biaya tidak penting",
|
|
||||||
"Cari sumber pemasukan baru",
|
|
||||||
],
|
|
||||||
"impact_label": "Cashflow/budget",
|
|
||||||
"priority": 10,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kategori": "Karier",
|
"kategori": "Karier",
|
||||||
"keyword": ["kerja", "pekerjaan", "cv", "skill", "karir", "karier"],
|
"keyword": ["kerja", "pekerjaan", "cv", "skill", "karir", "karier"],
|
||||||
@ -361,41 +446,26 @@ ANALYSIS_DATABASE = [
|
|||||||
"impact_label": "Dampak karier",
|
"impact_label": "Dampak karier",
|
||||||
"priority": 10,
|
"priority": 10,
|
||||||
},
|
},
|
||||||
|
SECTOR_DATABASE["logistik"],
|
||||||
|
SECTOR_DATABASE["teknologi"],
|
||||||
{
|
{
|
||||||
"kategori": "Logistik",
|
"kategori": "Umum",
|
||||||
"keyword": ["kirim", "pengiriman", "barang", "gudang", "rute"],
|
"keyword": [],
|
||||||
"penyebab": [
|
"penyebab": [
|
||||||
"Rute tidak optimal",
|
"Tujuan dan batasan belum cukup spesifik",
|
||||||
"Monitoring kurang",
|
"Data pendukung belum lengkap",
|
||||||
"Proses distribusi lambat",
|
"Opsi solusi belum diprioritaskan",
|
||||||
],
|
],
|
||||||
"solusi": [
|
"solusi": [
|
||||||
"Optimasi rute",
|
"Perjelas tujuan dan indikator sukses",
|
||||||
"Tracking barang",
|
"Kumpulkan data utama sebelum mengambil keputusan",
|
||||||
"Perbaiki sistem distribusi",
|
"Bandingkan opsi dengan skor dampak, biaya, waktu, dan risiko",
|
||||||
],
|
],
|
||||||
"impact_label": "Operasional",
|
"impact_label": "Perlu validasi",
|
||||||
"priority": 10,
|
"priority": 0,
|
||||||
},
|
|
||||||
{
|
|
||||||
"kategori": "Teknologi",
|
|
||||||
"keyword": ["aplikasi", "website", "coding", "program", "error", "bug"],
|
|
||||||
"penyebab": [
|
|
||||||
"Sistem belum optimal",
|
|
||||||
"Arsitektur kurang tepat",
|
|
||||||
"Bug perangkat lunak",
|
|
||||||
],
|
|
||||||
"solusi": [
|
|
||||||
"Audit sistem",
|
|
||||||
"Perbaiki kode",
|
|
||||||
"Optimasi teknologi",
|
|
||||||
],
|
|
||||||
"impact_label": "Teknis/operasional",
|
|
||||||
"priority": 10,
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def _detect_problem_category(description):
|
def _detect_problem_category(description):
|
||||||
text = description.lower()
|
text = description.lower()
|
||||||
best_item = None
|
best_item = None
|
||||||
@ -411,12 +481,14 @@ def _detect_problem_category(description):
|
|||||||
score += 35
|
score += 35
|
||||||
if item["kategori"] == "Pendidikan" and _has_any(text, ["singapura", "singapore", "jepang", "japan"]):
|
if item["kategori"] == "Pendidikan" and _has_any(text, ["singapura", "singapore", "jepang", "japan"]):
|
||||||
score += 20
|
score += 20
|
||||||
|
if item["kategori"] == "Pemerintah" and _has_any(text, ["bumn", "kementerian", "pemerintah", "anggaran negara", "layanan publik"]):
|
||||||
|
score += 25
|
||||||
|
|
||||||
if score > best_score:
|
if score > best_score:
|
||||||
best_item = item
|
best_item = item
|
||||||
best_score = score
|
best_score = score
|
||||||
|
|
||||||
return best_item or next(item for item in ANALYSIS_DATABASE if item["kategori"] == "Bisnis")
|
return best_item or next(item for item in ANALYSIS_DATABASE if item["kategori"] == "Umum")
|
||||||
|
|
||||||
|
|
||||||
def _is_education_decision(description):
|
def _is_education_decision(description):
|
||||||
@ -437,7 +509,7 @@ def _infer_business_area(description):
|
|||||||
text = description.lower()
|
text = description.lower()
|
||||||
kategori = _detect_problem_category(description)["kategori"]
|
kategori = _detect_problem_category(description)["kategori"]
|
||||||
|
|
||||||
if kategori == "Pendidikan":
|
if kategori in {"Pendidikan", "Pemerintah", "Umum"}:
|
||||||
return ProblemCase.AREA_OTHER
|
return ProblemCase.AREA_OTHER
|
||||||
if kategori == "Keuangan":
|
if kategori == "Keuangan":
|
||||||
return ProblemCase.AREA_FINANCE
|
return ProblemCase.AREA_FINANCE
|
||||||
@ -656,7 +728,7 @@ def home(request):
|
|||||||
"form": form,
|
"form": form,
|
||||||
"recent_cases": recent_cases,
|
"recent_cases": recent_cases,
|
||||||
"page_title": "OPTEMA AI — MVP Decision Intelligence",
|
"page_title": "OPTEMA AI — MVP Decision Intelligence",
|
||||||
"meta_description": "OPTEMA AI membantu mengubah masalah bisnis, keuangan, karier, logistik, teknologi, dan pendidikan menjadi problem detection, root-cause analysis, decision scoring, dan action plan.",
|
"meta_description": "OPTEMA AI membantu mengubah masalah pemerintah/publik, bisnis, keuangan, karier, logistik, teknologi, dan pendidikan menjadi problem detection, root-cause analysis, decision scoring, dan action plan.",
|
||||||
}
|
}
|
||||||
return render(request, "core/index.html", context)
|
return render(request, "core/index.html", context)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user