▶ Play Demo
⏸ Pause
▶ Continue
■ Reset
Kelajuan
0.5×
← Perlahan · Cepat →
ALG Tekan Play Demo untuk lihat bagaimana CategoryAlgo bergerak dari keyword match ke review fallback.
1. Command
2. Analyze
3. Script
4. Diagram
5. Lookup
6. Simulasi
7. Report
Demo Complete — Algorithm Flow Ready
01 WhatsApp Command
Next →
02 Requirement Analysis
← Prev Next →
4 Sample Rows
2 Rule Matches
1 Fuzzy Fallback
1 Needs Review
4 Detected Categories
Menunggu Sedang aktif Selesai
This demo reflects the algorithm flow from CategoryAlgo.php and the learning surface in catdict.php .
03 PHP Algorithm Flow
← Prev Next →
RG Ringkas PH PHP Flow
1
IN
Normalize description Trim, uppercase, and prep the bank text
2
RM
Run rule / keyword match Match against known catdict rows and patterns
3
FB
Fallback if needed Use fuzzy or manual review path when confidence is low
4
SV
Save result Persist algo_category, algo_reason, and review flag
$result = CategoryAlgo::categorize($tx);
if ($result['confidence_score'] < 70) {
$result['needs_review'] = true;
}
save_algo_result($tx['id'], [
'algo_category' => $result['final_category'],
'algo_confidence' => $result['confidence_score'],
'algo_match_type' => $result['match_type'],
'algo_reason' => $result['explanation'],
'algo_needs_review' => $result['needs_review'] ? 1 : 0,
]);
if (!empty($manual_category)) {
catdictSaveManualCategory(
$tx['description'],
(float)$tx['debit'],
(float)$tx['credit'],
$manual_category,
$tx['source_sheet'] ?? ''
);
}
Download PHP Snippet
04 Algorithm Diagram
← Prev Next →
Menunggu Sedang aktif Selesai
05 CatDict + Review Loop
← Prev Next →
What CatDict does
Stores learned descriptions and categories
Helps future runs hit better matches
Acts as the learning surface, not just a lookup table
What save-algo-results does
Writes algo_category and algo_reason back to transactions
Marks low-confidence rows for review
Keeps the classified output searchable later
Input
Bank statement row Description, debit, credit, and source sheet arrive from recompile-mbb.
Decision
CategoryAlgo Match rule, fallback, or review path based on confidence.
Memory
CatDict Manual category corrections improve the next run.
For this demo, the URL you should share is https://ainna.bond/ainna/demos/bank-statement-category-algo/ .
06 Live Classification Sample
← Prev Next →
Ready
07 Algorithm Report
← Prev
This demo is meant to show the real flow: catdict.php for learning/review, CategoryAlgo.php for inference, and save-algo-results.php for persistence.
Terminal Log
[SISTEM] Category algorithm demo sedia
System Architecture
IN Input Layer
Bank statement row
Source sheet
Debit / credit
AL Algorithm Layer
CategoryAlgo.php
Rule match
Fallback logic
LR Learning Layer
catdict.php
Manual category save
Review queue
Safety Notes
Review low-confidence rows before using the categories in production.
CatDict is a learning surface, not the sole source of truth.
Keep the manual override path available for exceptions.
Browser demo uses sample rows only.