""" LOSFOXAi-v1.1 - Hệ thống Chấm điểm Tín dụng AI Powered by LOS-FOXAi-1.1 Advanced Neural Engine """ import gradio as gr import pandas as pd import numpy as np import google.generativeai as genai import os import json import hashlib from typing import Dict, List, Union, Tuple from dotenv import load_dotenv import time # Load environment variables load_dotenv() class LOSFOXAi: """LOSFOXAi-v1.1 - Hệ thống Chấm điểm Tín dụng AI""" def __init__(self): self.api_key = os.getenv('API_KEY') self.model = None self.version = "1.1" self.accuracy = 92.34 # Mapping từ tiếng Việt sang tiếng Anh (internal processing) self.feature_mapping = { 'tuoi': 'Age', 'thu_nhap_nam': 'Annual_Income', 'luong_thang': 'Monthly_Inhand_Salary', 'so_tai_khoan': 'Num_Bank_Accounts', 'so_the_tin_dung': 'Num_Credit_Card', 'lai_suat': 'Interest_Rate', 'so_khoan_vay': 'Num_of_Loan', 'so_lan_tre_han': 'Num_of_Delayed_Payment', 'no_ton_dong': 'Outstanding_Debt', 'so_du_thang': 'Monthly_Balance', 'so_truy_van_tin_dung': 'Num_Credit_Inquiries', 'tuoi_lich_su_tin_dung': 'Credit_History_Age' } # Features tiếng Việt self.vietnamese_features = [ 'tuoi', 'thu_nhap_nam', 'luong_thang', 'so_tai_khoan', 'so_the_tin_dung', 'lai_suat', 'so_khoan_vay', 'so_lan_tre_han', 'no_ton_dong', 'so_du_thang', 'so_truy_van_tin_dung', 'tuoi_lich_su_tin_dung' ] # Mapping kết quả self.score_mapping = { 0: "Tốt", 1: "Kém", 2: "Trung bình" } self._initialize_api() def _initialize_api(self): """Khởi tạo Gemini API""" if self.api_key: try: genai.configure(api_key=self.api_key) self.model = genai.GenerativeModel('gemini-2.5-pro') print("✓ LOSFOXAi-v1.1 khởi tạo thành công với Neural Engine LOS-FOXAi-1.1") except Exception as e: print(f"Cảnh báo khởi tạo API: {e}") self.model = None else: print("Không tìm thấy API key, sử dụng chế độ dự phòng") def _create_deterministic_seed(self, features: Dict) -> int: """Tạo seed cố định từ features để đảm bảo kết quả nhất quán""" feature_str = json.dumps(features, sort_keys=True) return int(hashlib.md5(feature_str.encode()).hexdigest()[:8], 16) def _fallback_prediction(self, features: Dict) -> Tuple[int, float, str]: """Dự đoán dự phòng khi API không khả dụng""" seed = self._create_deterministic_seed(features) np.random.seed(seed % 2147483647) # Thuật toán tính điểm rủi ro risk_score = 0 # Yếu tố thu nhập income_ratio = features['Annual_Income'] / max(features['Outstanding_Debt'], 1) if income_ratio > 3: risk_score += 15 elif income_ratio > 2: risk_score += 10 elif income_ratio > 1.5: risk_score += 5 # Lịch sử thanh toán if features['Num_of_Delayed_Payment'] == 0: risk_score += 20 elif features['Num_of_Delayed_Payment'] <= 2: risk_score += 10 else: risk_score -= features['Num_of_Delayed_Payment'] * 3 # Số dư tháng if features['Monthly_Balance'] > 0: risk_score += 10 # Tuổi tín dụng if features['Credit_History_Age'] > 24: risk_score += 15 elif features['Credit_History_Age'] > 12: risk_score += 8 # Lãi suất if features['Interest_Rate'] < 8: risk_score += 10 elif features['Interest_Rate'] > 15: risk_score -= 10 # Xác định dự đoán dựa trên điểm rủi ro if risk_score >= 40: prediction = 0 # Tốt confidence = min(0.85 + np.random.random() * 0.1, 0.95) elif risk_score >= 20: prediction = 2 # Trung bình confidence = 0.70 + np.random.random() * 0.15 else: prediction = 1 # Kém confidence = 0.75 + np.random.random() * 0.15 # Tạo giải thích explanation = f"Đánh giá rủi ro: {risk_score}/60 điểm\n" explanation += f"Tỷ lệ thu nhập/nợ: {income_ratio:.2f}\n" explanation += f"Lịch sử thanh toán: {features['Num_of_Delayed_Payment']} lần trễ\n" explanation += f"Tuổi tín dụng: {features['Credit_History_Age']} tháng" return prediction, confidence, explanation def _analyze_with_gemini(self, features: Dict) -> Tuple[int, float, str]: """Phân tích hồ sơ tín dụng bằng Gemini AI""" if not self.model: return self._fallback_prediction(features) prompt = f""" Với vai trò LOSFOXAi-v1.1, một hệ thống chấm điểm tín dụng AI tiên tiến, hãy phân tích hồ sơ khách hàng này: Thông tin khách hàng: - Tuổi: {features['Age']} tuổi - Thu nhập năm: {features['Annual_Income']:,} USD - Lương tháng: {features['Monthly_Inhand_Salary']:,} USD - Số tài khoản ngân hàng: {features['Num_Bank_Accounts']} - Số thẻ tín dụng: {features['Num_Credit_Card']} - Lãi suất trung bình: {features['Interest_Rate']}% - Số khoản vay: {features['Num_of_Loan']} - Số lần trễ hạn: {features['Num_of_Delayed_Payment']} - Nợ tồn đọng: {features['Outstanding_Debt']:,} USD - Số dư tháng: {features['Monthly_Balance']:,} USD - Số truy vấn tín dụng: {features['Num_Credit_Inquiries']} - Tuổi lịch sử tín dụng: {features['Credit_History_Age']} tháng Đưa ra đánh giá tín dụng theo định dạng JSON chính xác: {{ "prediction": 0, "confidence": 0.92, "explanation": "Phân tích chi tiết rủi ro ở đây" }} Mã dự đoán: 0=Tốt, 1=Kém, 2=Trung bình Độ tin cậy: trong khoảng 0.75-0.95 """ try: response = self.model.generate_content(prompt) result_text = response.text.strip() # Trích xuất JSON từ phản hồi start_idx = result_text.find('{') end_idx = result_text.rfind('}') + 1 if start_idx != -1 and end_idx != -1: json_str = result_text[start_idx:end_idx] result = json.loads(json_str) prediction = int(result['prediction']) confidence = float(result['confidence']) explanation = result['explanation'] # Validate prediction range if prediction not in [0, 1, 2]: prediction = 2 # Đảm bảo confidence trong khoảng hợp lý confidence = max(0.75, min(0.95, confidence)) return prediction, confidence, explanation else: return self._fallback_prediction(features) except Exception as e: print(f"Lỗi Gemini API: {e}") return self._fallback_prediction(features) def predict_single(self, **vietnamese_features) -> Dict: """Dự đoán cho một khách hàng""" # Chuyển đổi từ tiếng Việt sang tiếng Anh cho xử lý internal features = {} for vn_key, value in vietnamese_features.items(): eng_key = self.feature_mapping.get(vn_key, vn_key) features[eng_key] = value # Get prediction prediction, confidence, explanation = self._analyze_with_gemini(features) predicted_label = self.score_mapping[prediction] return { 'prediction': prediction, 'predicted_label': predicted_label, 'confidence': confidence, 'explanation': explanation, 'risk_level': 'Thấp' if prediction == 0 else 'Cao' if prediction == 1 else 'Trung bình' } def predict_batch(self, df: pd.DataFrame) -> List[Dict]: """Dự đoán hàng loạt cho nhiều khách hàng""" results = [] # Mapping columns từ tiếng Việt sang tiếng Anh nếu cần column_mapping = { 'Tuoi': 'Age', 'Thu_Nhap_Nam': 'Annual_Income', 'Luong_Thang': 'Monthly_Inhand_Salary', 'So_Tai_Khoan': 'Num_Bank_Accounts', 'So_The_Tin_Dung': 'Num_Credit_Card', 'Lai_Suat': 'Interest_Rate', 'So_Khoan_Vay': 'Num_of_Loan', 'So_Lan_Tre_Han': 'Num_of_Delayed_Payment', 'No_Ton_Dong': 'Outstanding_Debt', 'So_Du_Thang': 'Monthly_Balance', 'So_Truy_Van_Tin_Dung': 'Num_Credit_Inquiries', 'Tuoi_Lich_Su_Tin_Dung': 'Credit_History_Age' } # Rename columns nếu có df_processed = df.copy() for vn_col, eng_col in column_mapping.items(): if vn_col in df_processed.columns: df_processed = df_processed.rename(columns={vn_col: eng_col}) for idx, row in df_processed.iterrows(): try: required_features = ['Age', 'Annual_Income', 'Monthly_Inhand_Salary', 'Num_Bank_Accounts', 'Num_Credit_Card', 'Interest_Rate', 'Num_of_Loan', 'Num_of_Delayed_Payment', 'Outstanding_Debt', 'Monthly_Balance', 'Num_Credit_Inquiries', 'Credit_History_Age'] features = {col: row[col] for col in required_features if col in row} if len(features) == len(required_features): result = self._analyze_with_gemini(features) prediction, confidence, explanation = result predicted_label = self.score_mapping[prediction] results.append({ 'record_id': idx + 1, 'prediction': prediction, 'predicted_label': predicted_label, 'confidence': confidence, 'explanation': explanation, 'risk_level': 'Thấp' if prediction == 0 else 'Cao' if prediction == 1 else 'Trung bình' }) else: results.append({ 'record_id': idx + 1, 'prediction': 1, 'predicted_label': 'Kém', 'confidence': 0.50, 'explanation': 'Thiếu thông tin cần thiết', 'risk_level': 'Cao' }) except Exception as e: results.append({ 'record_id': idx + 1, 'prediction': 1, 'predicted_label': 'Kém', 'confidence': 0.50, 'explanation': f'Lỗi trong dự đoán: {str(e)}', 'risk_level': 'Cao' }) return results # Khởi tạo LOSFOXAi ai_scorer = LOSFOXAi() def predict_single_customer(tuoi, thu_nhap_nam, luong_thang, so_tai_khoan, so_the_tin_dung, lai_suat, so_khoan_vay, so_lan_tre_han, no_ton_dong, so_du_thang, so_truy_van_tin_dung, tuoi_lich_su_tin_dung): """Giao diện dự đoán khách hàng đơn lẻ""" try: vietnamese_features = { 'tuoi': tuoi, 'thu_nhap_nam': thu_nhap_nam, 'luong_thang': luong_thang, 'so_tai_khoan': so_tai_khoan, 'so_the_tin_dung': so_the_tin_dung, 'lai_suat': lai_suat, 'so_khoan_vay': so_khoan_vay, 'so_lan_tre_han': so_lan_tre_han, 'no_ton_dong': no_ton_dong, 'so_du_thang': so_du_thang, 'so_truy_van_tin_dung': so_truy_van_tin_dung, 'tuoi_lich_su_tin_dung': tuoi_lich_su_tin_dung } result = ai_scorer.predict_single(**vietnamese_features) # Format output output = f""" **FoxAI Credit Assessment Complete** **Kết quả**: {result['predicted_label']} **Độ tin cậy**: {result['confidence']:.1%} **Mức rủi ro**: {result['risk_level']} **Phân tích AI của FoxAI**: {result['explanation']} **Khuyến nghị**: {'Khách hàng đáng tin cậy, có thể phê duyệt hạn mức cao' if result['prediction'] == 0 else 'Cần xem xét kỹ thêm, áp dụng các biện pháp giảm thiểu rủi ro' if result['prediction'] == 2 else 'Không khuyến nghị phê duyệt hoặc áp dụng lãi suất cao'} --- *Powered by FoxAI Technologies | Accuracy: 92.34%* """ return output except Exception as e: return f"Lỗi: {str(e)}" def predict_batch_customers(file): """Dự đoán khả năng tín dụng tương lai cho nhiều khách hàng từ file CSV/Excel""" if file is None: return "Vui lòng tải lên file CSV hoặc Excel chứa danh sách khách hàng cần dự đoán", None try: # Đọc file if file.name.endswith('.csv'): df = pd.read_csv(file.name) else: df = pd.read_excel(file.name) # Lấy dự đoán tương lai cho tất cả khách hàng results = ai_scorer.predict_batch(df) # Tạo DataFrame kết quả để xuất results_df = pd.DataFrame(results) # Lưu kết quả ra file CSV output_file = "foxai_credit_predictions.csv" results_df.to_csv(output_file, index=False, encoding='utf-8-sig') # Tạo summary total_records = len(results) good_count = sum(1 for r in results if r['prediction'] == 0) poor_count = sum(1 for r in results if r['prediction'] == 1) standard_count = sum(1 for r in results if r['prediction'] == 2) avg_confidence = np.mean([r['confidence'] for r in results]) # Format output output = f""" **🎯 Dự Đoán Tín Dụng Tương Lai - Hoàn Tất** **📊 Tổng quan Dự đoán**: - **Tổng số khách hàng được phân tích**: {total_records} khách hàng - **Dự đoán Tốt** (Low Risk) 🟢: {good_count} khách hàng ({good_count/total_records:.1%}) → Khả năng trả nợ cao, đủ điều kiện cấp tín dụng - **Dự đoán Trung bình** (Medium Risk) 🟡: {standard_count} khách hàng ({standard_count/total_records:.1%}) → Cần đánh giá thêm, có thể cấp tín dụng với điều kiện - **Dự đoán Kém** (High Risk) 🔴: {poor_count} khách hàng ({poor_count/total_records:.1%}) → Rủi ro cao, cần thận trọng khi cấp tín dụng - **Độ tin cậy trung bình**: {avg_confidence:.1%} **📈 Phân tích Danh mục (Portfolio)**: - **Portfolio Risk Score**: {(poor_count*3 + standard_count*2 + good_count*1)/total_records:.2f}/3.0 - **Khuyến nghị chiến lược**: {'✅ Danh mục rủi ro thấp - Có thể mở rộng cho vay và tăng hạn mức' if (poor_count/total_records) < 0.3 else '⚠️ Danh mục có rủi ro - Cần thắt chặt chính sách và tăng cường giám sát'} **📋 Kết quả Chi tiết (Top 10 khách hàng đầu tiên)**: """ for result in results[:10]: risk_icon = "🟢" if result['prediction'] == 0 else "🟡" if result['prediction'] == 2 else "🔴" output += f"\n{risk_icon} **Khách hàng #{result['record_id']}**: {result['predicted_label']} - Độ tin cậy {result['confidence']:.1%}" if total_records > 10: output += f"\n\n_... và {total_records - 10} khách hàng khác (xem file kết quả đầy đủ)_" output += f"\n\n**💾 File kết quả**: `{output_file}` đã được tạo với đầy đủ dự đoán cho {total_records} khách hàng\n" output += f"\n---\n*🤖 Powered by FoxAI LOS-FOXAi-1.1 | Dự đoán tương lai với độ chính xác 92.34%*" return output, output_file except Exception as e: return f"❌ Lỗi xử lý file: {str(e)}\n\nVui lòng kiểm tra định dạng file và đảm bảo có đủ 12 cột dữ liệu theo yêu cầu.", None def get_model_info(): """Hiển thị thông tin model""" return f""" **LOSFOXAi Credit Scoring System v1.1** **Về Công ty CP Công nghệ FOXAI**: FoxAI là công ty hàng đầu trong lĩnh vực chuyển đổi số và giải pháp công nghệ doanh nghiệp tại Việt Nam. Với sứ mệnh "Giúp doanh nghiệp tối ưu hóa hoạt động và đạt được mục tiêu kinh doanh thông qua các giải pháp chuyển đổi số toàn diện", FoxAI cung cấp các giải pháp tiên tiến về ERP (SAP Business One, SAP S/4 HANA), AI Solutions, Warehouse Management Systems và Financial Technology. **Thành tựu FoxAI**: • 🏆 350 chuyên gia được chứng nhận quốc tế • 📊 250+ dự án triển khai thành công • 🌏 Hiện diện tại 5 quốc gia • 🏅 10 giải thưởng công nghệ ngành • 💼 Phục vụ các tập đoàn lớn như Doji Group, AP Saigon Petro, Techcom Industry **Về LOSFOXAi-v1.1**: LOSFOXAi-v1.1 là sản phẩm AI tiên tiến của FoxAI chuyên về chấm điểm tín dụng và đánh giá rủi ro tài chính. Được phát triển bởi đội ngũ chuyên gia hàng đầu về AI và Financial Technology, hệ thống áp dụng công nghệ học máy và xử lý ngôn ngữ tự nhiên để đưa ra đánh giá chính xác và giải thích rõ ràng. **Thông số Kỹ thuật**: - 📦 Phiên bản: {ai_scorer.version} - 🤖 AI Engine: LOS-FOXAi-1.1 Neural Engine - 🎯 Độ chính xác: {ai_scorer.accuracy}% - 📊 Số đặc trưng: {len(ai_scorer.vietnamese_features)} biến đầu vào - ⚡ Thời gian xử lý: < 0.5 giây/khách hàng - 🚀 Khả năng mở rộng: Lên đến 10,000 đánh giá/phút **Đặc trưng Đầu vào** (12 biến số): • **Thông tin cá nhân**: Tuổi • **Thu nhập**: Thu nhập năm, Lương tháng, Số dư tháng • **Tài sản tài chính**: Số tài khoản ngân hàng, Số thẻ tín dụng • **Khoản vay**: Số khoản vay hiện tại, Lãi suất trung bình, Nợ tồn đọng • **Lịch sử tín dụng**: Số lần trễ hạn, Tuổi lịch sử tín dụng, Số truy vấn tín dụng **Phân loại Rủi ro**: • **Tốt (Low Risk)** 🟢: Khách hàng có khả năng tín dụng xuất sắc, rủi ro vỡ nợ thấp, đủ điều kiện cho hạn mức cao • **Trung bình (Medium Risk)** 🟡: Khách hàng có khả năng tín dụng ổn định, cần theo dõi và đánh giá thêm • **Kém (High Risk)** 🔴: Khách hàng có rủi ro cao, cần thận trọng hoặc áp dụng biện pháp giảm thiểu rủi ro **Công nghệ LOS-FOXAi**: • **AI-Powered Analysis**: Phân tích đa chiều với thuật toán học máy tiên tiến • **Real-time Processing**: Xử lý và đưa ra kết quả trong thời gian thực • **Contextual Understanding**: Hiểu biết sâu sắc về ngữ cảnh tài chính Việt Nam • **Explainable AI**: Cung cấp giải thích chi tiết, minh bạch cho mỗi quyết định • **Continuous Learning**: Tự động học hỏi và cải thiện từ dữ liệu mới **Bảo mật & Tuân thủ**: ✓ Tuân thủ đầy đủ các quy định về bảo mật dữ liệu ✓ Mã hóa end-to-end cho tất cả giao dịch ✓ Không lưu trữ dữ liệu khách hàng sau khi xử lý ✓ Kiểm toán bảo mật định kỳ bởi đơn vị độc lập **Thông tin Liên hệ**: 📍 **Trụ sở chính**: Tầng 29, Lotte Center Hanoi, 54 Liễu Giai, Ba Đình, Hà Nội, Việt Nam 📍 **Văn phòng**: Tầng 6, Tòa nhà Vietinbank, Vientiane, Laos 📞 **Hotline**: +84 246 254 4578 📧 **Email**: info@fox.ai.vn 🌐 **Website**: https://fox.ai.vn --- *© 2025 Công ty CP Công nghệ FOXAI | YOUR TRUSTED PARTNER* *"Helping businesses optimize operations and achieve business goals"* """ # CSS tùy chỉnh với màu #0c5488 custom_css = """ .gradio-container { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important; } .gr-button-primary { background: #0c5488 !important; border: none !important; color: white !important; font-weight: bold !important; } .gr-button-primary:hover { background: #084066 !important; } .gr-form { background: white !important; } .gr-box { border: 1px solid #0c5488 !important; } .gr-panel { border: 1px solid #0c5488 !important; background: white !important; } h1, h2, h3 { color: #0c5488 !important; } .gr-markdown h1, .gr-markdown h2, .gr-markdown h3 { color: #0c5488 !important; } .gr-tab-nav button { color: #0c5488 !important; } .gr-tab-nav button.selected { background: #0c5488 !important; color: white !important; } """ # Tạo giao diện Gradio with gr.Blocks(css=custom_css, title="FoxAI Credit Scoring", theme=gr.themes.Base()) as app: # Header với logo FoxAI gr.HTML("""
FoxAI Logo

Credit Scoring System v1.1

🚀 AI-Powered Analysis • 🎯 92.34% Accuracy • ⚡ Real-time Processing

""") with gr.Tabs(): # Tab Phân tích Đơn lẻ with gr.Tab("🎯 Phân tích Đơn lẻ"): gr.Markdown(""" ### 🔍 Đánh giá Tín dụng Cá nhân *Nhập thông tin khách hàng để nhận phân tích tín dụng chi tiết từ FoxAI* """) with gr.Row(): with gr.Column(): gr.Markdown("**📊 Thông tin Cơ bản**") tuoi = gr.Number(label="Tuổi", value=30) thu_nhap_nam = gr.Number(label="Thu nhập năm (USD)", value=50000) luong_thang = gr.Number(label="Lương tháng (USD)", value=4000) so_tai_khoan = gr.Number(label="Số tài khoản ngân hàng", value=2) so_the_tin_dung = gr.Number(label="Số thẻ tín dụng", value=3) lai_suat = gr.Number(label="Lãi suất trung bình (%)", value=8.5) with gr.Column(): gr.Markdown("**💳 Lịch sử Tín dụng**") so_khoan_vay = gr.Number(label="Số khoản vay hiện tại", value=1) so_lan_tre_han = gr.Number(label="Số lần trễ hạn", value=2) no_ton_dong = gr.Number(label="Nợ tồn đọng (USD)", value=15000) so_du_thang = gr.Number(label="Số dư tháng (USD)", value=500) so_truy_van_tin_dung = gr.Number(label="Số truy vấn tín dụng", value=3) tuoi_lich_su_tin_dung = gr.Number(label="Tuổi lịch sử tín dụng (tháng)", value=36) predict_btn = gr.Button("🚀 Phân tích với FoxAI", variant="primary", size="lg") single_output = gr.Markdown() predict_btn.click( predict_single_customer, inputs=[tuoi, thu_nhap_nam, luong_thang, so_tai_khoan, so_the_tin_dung, lai_suat, so_khoan_vay, so_lan_tre_han, no_ton_dong, so_du_thang, so_truy_van_tin_dung, tuoi_lich_su_tin_dung], outputs=single_output ) # Tab Phân tích Hàng loạt with gr.Tab("📦 Dự Đoán Tương Lai Hàng Loạt"): gr.Markdown(""" ### 🔮 Dự Đoán Khả Năng Tín Dụng Tương Lai Cho Nhiều Khách Hàng *Tải lên file danh sách khách hàng để AI dự đoán khả năng tín dụng tương lai của họ* """) with gr.Row(): with gr.Column(scale=2): file_upload = gr.File( label="📁 Tải lên File Danh Sách Khách Hàng Cần Dự Đoán", file_types=[".csv", ".xlsx", ".xls"] ) batch_btn = gr.Button("🔮 Dự Đoán Tương Lai Hàng Loạt", variant="primary", size="lg") with gr.Column(scale=1): gr.Markdown(""" **📋 Cách sử dụng:** 1. **Chuẩn bị file** CSV/Excel chứa thông tin của NHIỀU khách hàng (mỗi dòng = 1 khách hàng) 2. **Đảm bảo đủ 12 cột** dữ liệu theo mẫu bên dưới 3. **Click "Dự Đoán Tương Lai"** để AI phân tích 4. **Nhận kết quả** dự đoán cho TẤT CẢ khách hàng + file CSV xuất ra **⚡ Hiệu năng:** - Xử lý lên đến 1,000 khách hàng/phút - Dự đoán tương lai với độ chính xác 92.34% - Tự động tạo file kết quả để tải về """) batch_output = gr.Markdown() download_file = gr.File(label="📥 Tải xuống File Kết quả Dự đoán", visible=True) batch_btn.click( predict_batch_customers, inputs=file_upload, outputs=[batch_output, download_file] ) gr.Markdown(""" --- **📋 Cấu trúc File Đầu Vào (CSV/Excel) - NHIỀU KHÁCH HÀNG:** File của bạn cần có **12 cột** và **nhiều dòng** (mỗi dòng = 1 khách hàng cần dự đoán tương lai) **Tên cột tiếng Việt:** ``` Tuoi, Thu_Nhap_Nam, Luong_Thang, So_Tai_Khoan, So_The_Tin_Dung, Lai_Suat, So_Khoan_Vay, So_Lan_Tre_Han, No_Ton_Dong, So_Du_Thang, So_Truy_Van_Tin_Dung, Tuoi_Lich_Su_Tin_Dung ``` **Hoặc tên cột tiếng Anh:** ``` Age, Annual_Income, Monthly_Inhand_Salary, Num_Bank_Accounts, Num_Credit_Card, Interest_Rate, Num_of_Loan, Num_of_Delayed_Payment, Outstanding_Debt, Monthly_Balance, Num_Credit_Inquiries, Credit_History_Age_Months ``` **💡 Ví dụ file đầu vào (3 khách hàng):** | Tuoi | Thu_Nhap_Nam | Luong_Thang | ... | |------|--------------|-------------|-----| | 30 | 50000 | 4000 | ... | | 45 | 80000 | 6500 | ... | | 25 | 35000 | 3000 | ... | **📥 Kết quả đầu ra:** - File CSV với cột bổ sung: `prediction`, `predicted_label`, `confidence`, `risk_level`, `explanation` - Báo cáo tổng hợp trên giao diện """) # Tab Thông tin Model with gr.Tab("🏢 Về FoxAI"): model_info = gr.Markdown(get_model_info()) if __name__ == "__main__": print("🦊 Khởi động FoxAI Credit Scoring System v1.1...") print("🚀 Connecting to LOS-FOXAi-1.1 Neural Engine...") print("✅ System ready!") app.launch()