Spaces:
Sleeping
Sleeping
File size: 1,434 Bytes
5ff5d4c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
import pandas as pd
import joblib
from config import TFIDF_VECTORIZER_PATH, MODEL_PATH
# Sample Input Text
test_text = """
Transaction ID: T123456789
Origin: India
Designation: Manager
Keywords: sanction, fraud, transaction
Name: John Doe
SWIFT Tag: XYZ123
Currency: USD
Entity: ACME Corp
Message: Urgent transaction request
City: Mumbai
Country: India
State: Maharashtra
Hit Type: Sanctions
Record Matching String: match-123
WatchList Match String: sanction-456
Payment Sender: Sender ABC
Payment Receiver: Receiver XYZ
Swift Message Type: MT103
Text Sanction Data: suspected sanctions
Matched Sanctioned Entity: Entity123
Red Flag Reason: Unusual transfer
Risk Level: High
Risk Score: 85.5
CDD Level: Enhanced
PEP Status: Yes
Sanction Description: SDN List
Checker Notes: Needs further review
Sanction Context: Context of sanction
Maker Action: Escalated
Customer Type: Individual
Industry: Finance
Transaction Type: Wire
Transaction Channel: Online
Geographic Origin: India
Geographic Destination: Russia
Risk Category: Category A
Risk Drivers: Risky geography
Alert Status: Open
Investigation Outcome: Pending
Source of Funds: Unknown
Purpose of Transaction: Payment
Beneficial Owner: Jane Roe
"""
# Load models
vectorizer = joblib.load(TFIDF_VECTORIZER_PATH)
model = joblib.load(MODEL_PATH)
# Predict
test_vec = vectorizer.transform([test_text])
prediction = model.predict(test_vec)
print("Predicted Labels:", prediction[0])
|