#!/bin/bash echo "๐Ÿงช MALAYSIAN PRIORITY CLASSIFIER - INTERACTIVE TESTING" echo "=====================================================" echo "" echo "This script allows you to test the Malaysian Priority Classification Model" echo "with various examples and your own custom text." echo "" # Make sure classify_text.sh is executable chmod +x classify_text.sh echo "๐Ÿ“Š MODEL INFORMATION" echo "===================" echo "โ€ข Categories: Government, Economic, Law, Danger" echo "โ€ข Accuracy: 91% on test dataset" echo "โ€ข Language: Bahasa Malaysia (with English support)" echo "โ€ข Training Data: 5,707 Malaysian social media posts" echo "" echo "๐ŸŽฏ PRE-DEFINED TEST EXAMPLES" echo "============================" echo "" # Test examples array declare -a examples=( "Perdana Menteri Malaysia mengumumkan dasar ekonomi baharu untuk tahun 2025" "Bank Negara Malaysia menaikkan kadar faedah asas sebanyak 0.25 peratus" "Mahkamah Tinggi memutuskan kes rasuah melibatkan bekas menteri" "Banjir besar melanda negeri Kelantan, ribuan penduduk dipindahkan" "Kementerian Kesihatan Malaysia melaporkan peningkatan kes COVID-19" "Bursa Malaysia mencatatkan kenaikan indeks KLCI sebanyak 1.2%" "Polis tangkap suspek dalam kes jenayah kolar putih" "Gempa bumi 6.2 skala Richter menggegar pantai timur Sabah" "Parlimen Malaysia meluluskan rang undang-undang baharu" "Kemalangan jalan raya di lebuh raya utara-selatan" ) declare -a expected=( "Government" "Economic" "Law" "Danger" "Danger" "Economic" "Law" "Danger" "Government" "Danger" ) # Run predefined tests for i in "${!examples[@]}"; do echo "Test $((i+1)): ${examples[i]}" echo "Expected: ${expected[i]}" echo -n "Result: " result=$(./classify_text.sh "${examples[i]}") echo "$result" if [ "$result" = "${expected[i]}" ]; then echo "โœ… CORRECT" else echo "โŒ INCORRECT (Expected: ${expected[i]}, Got: $result)" fi echo "" done echo "๐Ÿ“ˆ PERFORMANCE SUMMARY" echo "=====================" echo "โ€ข Government Keywords: 50+ terms" echo "โ€ข Economic Keywords: 80+ terms" echo "โ€ข Law Keywords: 60+ terms" echo "โ€ข Danger Keywords: 70+ terms" echo "โ€ข Total Keywords: 260+ Malaysian-specific terms" echo "" echo "๐Ÿ”ง INTERACTIVE TESTING MODE" echo "===========================" echo "Enter your own Malaysian text to classify (or 'quit' to exit):" echo "" while true; do echo -n "Enter text: " read -r user_input if [ "$user_input" = "quit" ] || [ "$user_input" = "exit" ] || [ "$user_input" = "q" ]; then echo "๐Ÿ‘‹ Thank you for testing the Malaysian Priority Classifier!" break fi if [ -z "$user_input" ]; then echo "โš ๏ธ Please enter some text to classify." continue fi echo -n "Classification: " result=$(./classify_text.sh "$user_input") echo "$result" # Show confidence explanation case $result in "Government") echo "๐Ÿ“ This text contains government/political keywords" ;; "Economic") echo "๐Ÿ’ฐ This text contains economic/financial keywords" ;; "Law") echo "โš–๏ธ This text contains legal/law enforcement keywords" ;; "Danger") echo "๐Ÿšจ This text contains danger/emergency keywords" ;; *) echo "โ“ Classification uncertain - may need more context" ;; esac echo "" done echo "" echo "๐Ÿ“š USAGE EXAMPLES FOR DEVELOPERS" echo "================================" echo "" echo "# Basic usage" echo "./classify_text.sh \"Your Malaysian text here\"" echo "" echo "# Batch processing" echo "cat input.txt | while read line; do" echo " echo \"\$line: \$(./classify_text.sh \"\$line\")\"" echo "done" echo "" echo "# Python integration" echo "import subprocess" echo "result = subprocess.run(['./classify_text.sh', text], capture_output=True, text=True)" echo "category = result.stdout.strip()" echo "" echo "๐Ÿ”— Model Repository: https://huggingface.co/rmtariq/malaysian-priority-classifier" echo "๐Ÿ“„ Documentation: See README.md for complete usage guide" echo "โญ Star this model if you find it useful!"