From 0ab3040f298ed90873222a011fcb70d21beb6517 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 19 Jun 2026 16:04:15 +0000 Subject: [PATCH] OPTEMA AI --- core/__pycache__/forms.cpython-311.pyc | Bin 2272 -> 2335 bytes core/__pycache__/views.cpython-311.pyc | Bin 43786 -> 46264 bytes core/forms.py | 2 +- core/templates/core/index.html | 4 +- core/views.py | 198 +++++++++++++++++-------- 5 files changed, 138 insertions(+), 66 deletions(-) diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc index fe54f6151737107332cd87e376bf9e870abcfe25..ca0a07bb2164de3be70416d3105ac2c782729591 100644 GIT binary patch delta 211 zcmaDLIA4f&IWI340}wc-n`Uj@$ScoOpXHpNSCXG$rQj6m>!(munx3hUomiBbm#C1G znOK>qP?DLKo}Q_rke^$XTB1-=T2z{+U~HhOqmWpVSgMd+nv=#N<@{$#a=y8Rt&k&1}o|fr&xEhiUU~ H=BF$G;+04} delta 127 zcmbO)^gxhzIWI340}#kZnr6-1$Scp}=jWWCSCXG$rQltflbM*IkdmnooSB!NSWsG& zsE}BaSgPQaT9BBRuA`8Wn3t$vWMH6>Ra%m$qX1NtnWtc^P?DHYnx{~lnv+_bn7Mfx dlM*8%@8p}zvW&APe`mI3z9FB#*^1>U3jn>HD9``^ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 2512f3d02fbf6848789e876cf4643b39d0232edd..a295251d0fc7e43ef2e1160488427c553119db0a 100644 GIT binary patch delta 6605 zcmb7H3v^t?dA_r|clFj%-s2!<9k;eEB?BmAXk9D-w&-j_NO}p;T`Ox{|Zx$538K# zR+!}0a}Pd1;(QZXlM|;~?jXI(X`CD6p6v5tuTSw^xQ4fuEsnPfeHFbcm6f!&GA&1d z-r+6KgYV5(jrQT_*DC1|zd-vRCV)q6lpiK^fDTf6-mUnkGG~sD4qesrXL@uP=EqfA zz%d&GASOr`q{M_WtRPg&^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kjNB3vWn`*_HhnKuLVWnR=HR6tbFH+ewtoy%J`Y+bz1sF+lFm8U$GA04Wz ezwOX#>n8cOVIgN^oqZxv$cXR_tl`q>Q~v{kw!7~D diff --git a/core/forms.py b/core/forms.py index ae1e584..243e755 100644 --- a/core/forms.py +++ b/core/forms.py @@ -15,7 +15,7 @@ class ProblemCaseForm(forms.ModelForm): "description": forms.Textarea(attrs={ "class": "form-control problem-textarea", "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={ "type": "range", diff --git a/core/templates/core/index.html b/core/templates/core/index.html index b4b9bdd..128e8a5 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -16,7 +16,7 @@

Mesin Pemecah Masalah Universal & Decision Intelligence Platform

💡 OPTEMA AI

Optimal, Effective, Efficient Management Assistant

-

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.

+

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.

Jalankan Analisis AI Lihat Riwayat Case @@ -70,7 +70,7 @@ 📥

Input Masalah

-

Masukkan masalah, target, atau hambatan Anda. Contoh: kuliah Singapura/Jepang dengan budget terbatas.

+

Masukkan masalah, target, atau hambatan Anda. Contoh: BUMN rugi karena biaya tinggi, omzet toko turun, atau kuliah Singapura/Jepang dengan budget terbatas.

diff --git a/core/views.py b/core/views.py index 8e32400..188d8d3 100644 --- a/core/views.py +++ b/core/views.py @@ -228,6 +228,7 @@ def _build_case_insights(description, category=None): countries = case_data.get("countries") percentages = case_data.get("percentages") or [] 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": "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%"}, @@ -271,6 +272,12 @@ def _build_case_insights(description, category=None): if best["shortfall_low"] else 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: 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 = [ { "kategori": "Pendidikan", @@ -312,39 +427,9 @@ ANALYSIS_DATABASE = [ "impact_label": "Budget ketat", "priority": 50, }, - { - "kategori": "Bisnis", - "keyword": ["jualan", "penjualan", "produk", "usaha", "bisnis", "toko"], - "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, - }, + SECTOR_DATABASE["pemerintah"], + SECTOR_DATABASE["bisnis"], + SECTOR_DATABASE["keuangan"], { "kategori": "Karier", "keyword": ["kerja", "pekerjaan", "cv", "skill", "karir", "karier"], @@ -361,41 +446,26 @@ ANALYSIS_DATABASE = [ "impact_label": "Dampak karier", "priority": 10, }, + SECTOR_DATABASE["logistik"], + SECTOR_DATABASE["teknologi"], { - "kategori": "Logistik", - "keyword": ["kirim", "pengiriman", "barang", "gudang", "rute"], + "kategori": "Umum", + "keyword": [], "penyebab": [ - "Rute tidak optimal", - "Monitoring kurang", - "Proses distribusi lambat", + "Tujuan dan batasan belum cukup spesifik", + "Data pendukung belum lengkap", + "Opsi solusi belum diprioritaskan", ], "solusi": [ - "Optimasi rute", - "Tracking barang", - "Perbaiki sistem distribusi", + "Perjelas tujuan dan indikator sukses", + "Kumpulkan data utama sebelum mengambil keputusan", + "Bandingkan opsi dengan skor dampak, biaya, waktu, dan risiko", ], - "impact_label": "Operasional", - "priority": 10, - }, - { - "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, + "impact_label": "Perlu validasi", + "priority": 0, }, ] - def _detect_problem_category(description): text = description.lower() best_item = None @@ -411,12 +481,14 @@ def _detect_problem_category(description): score += 35 if item["kategori"] == "Pendidikan" and _has_any(text, ["singapura", "singapore", "jepang", "japan"]): score += 20 + if item["kategori"] == "Pemerintah" and _has_any(text, ["bumn", "kementerian", "pemerintah", "anggaran negara", "layanan publik"]): + score += 25 if score > best_score: best_item = item 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): @@ -437,7 +509,7 @@ def _infer_business_area(description): text = description.lower() kategori = _detect_problem_category(description)["kategori"] - if kategori == "Pendidikan": + if kategori in {"Pendidikan", "Pemerintah", "Umum"}: return ProblemCase.AREA_OTHER if kategori == "Keuangan": return ProblemCase.AREA_FINANCE @@ -656,7 +728,7 @@ def home(request): "form": form, "recent_cases": recent_cases, "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)