Spaces:
Sleeping
Sleeping
Create test.py
Browse files
test.py
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import json
|
| 3 |
+
|
| 4 |
+
# Replace this with your actual LogReg API endpoint
|
| 5 |
+
API_URL = "https://point9-ml-tfidf-logreg-project.hf.space/predict"
|
| 6 |
+
|
| 7 |
+
sample_payload = {
|
| 8 |
+
"transaction_data": {
|
| 9 |
+
"Transaction_Id": "TXN12345",
|
| 10 |
+
"Hit_Seq": 1,
|
| 11 |
+
"Hit_Id_List": "HIT789",
|
| 12 |
+
"Origin": "India",
|
| 13 |
+
"Designation": "Manager",
|
| 14 |
+
"Keywords": "fraud",
|
| 15 |
+
"Name": "John Doe",
|
| 16 |
+
"SWIFT_Tag": "TAG001",
|
| 17 |
+
"Currency": "INR",
|
| 18 |
+
"Entity": "ABC Ltd",
|
| 19 |
+
"Message": "Payment for services",
|
| 20 |
+
"City": "Hyderabad",
|
| 21 |
+
"Country": "India",
|
| 22 |
+
"State": "Telangana",
|
| 23 |
+
"Hit_Type": "Individual",
|
| 24 |
+
"Record_Matching_String": "John Doe",
|
| 25 |
+
"WatchList_Match_String": "Doe, John",
|
| 26 |
+
"Payment_Sender_Name": "John Doe",
|
| 27 |
+
"Payment_Reciever_Name": "Jane Smith",
|
| 28 |
+
"Swift_Message_Type": "MT103",
|
| 29 |
+
"Text_Sanction_Data": "Suspicious transfer to offshore account",
|
| 30 |
+
"Matched_Sanctioned_Entity": "John Doe",
|
| 31 |
+
"Is_Match": 1,
|
| 32 |
+
"Red_Flag_Reason": "High value transaction",
|
| 33 |
+
"Risk_Level": "High",
|
| 34 |
+
"Risk_Score": 87.5,
|
| 35 |
+
"Risk_Score_Description": "Very High",
|
| 36 |
+
"CDD_Level": "Enhanced",
|
| 37 |
+
"PEP_Status": "Yes",
|
| 38 |
+
"Value_Date": "2023-01-01",
|
| 39 |
+
"Last_Review_Date": "2023-06-01",
|
| 40 |
+
"Next_Review_Date": "2024-06-01",
|
| 41 |
+
"Sanction_Description": "OFAC List",
|
| 42 |
+
"Checker_Notes": "Urgent check required",
|
| 43 |
+
"Sanction_Context": "Payment matched with OFAC entry",
|
| 44 |
+
"Maker_Action": "Escalate",
|
| 45 |
+
"Customer_ID": 1001,
|
| 46 |
+
"Customer_Type": "Corporate",
|
| 47 |
+
"Industry": "Finance",
|
| 48 |
+
"Transaction_Date_Time": "2023-12-15T10:00:00",
|
| 49 |
+
"Transaction_Type": "Credit",
|
| 50 |
+
"Transaction_Channel": "Online",
|
| 51 |
+
"Originating_Bank": "ABC Bank",
|
| 52 |
+
"Beneficiary_Bank": "XYZ Bank",
|
| 53 |
+
"Geographic_Origin": "India",
|
| 54 |
+
"Geographic_Destination": "USA",
|
| 55 |
+
"Match_Score": 96.2,
|
| 56 |
+
"Match_Type": "Exact",
|
| 57 |
+
"Sanctions_List_Version": "2023-V5",
|
| 58 |
+
"Screening_Date_Time": "2023-12-15T09:55:00",
|
| 59 |
+
"Risk_Category": "Sanctions",
|
| 60 |
+
"Risk_Drivers": "PEP, High Value",
|
| 61 |
+
"Alert_Status": "Open",
|
| 62 |
+
"Investigation_Outcome": "Pending",
|
| 63 |
+
"Case_Owner_Analyst": "analyst1",
|
| 64 |
+
"Escalation_Level": "L2",
|
| 65 |
+
"Escalation_Date": "2023-12-16",
|
| 66 |
+
"Regulatory_Reporting_Flags": True,
|
| 67 |
+
"Audit_Trail_Timestamp": "2023-12-15T10:05:00",
|
| 68 |
+
"Source_Of_Funds": "Corporate Account",
|
| 69 |
+
"Purpose_Of_Transaction": "Service Payment",
|
| 70 |
+
"Beneficial_Owner": "John Doe",
|
| 71 |
+
"Sanctions_Exposure_History": False
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
headers = {"Content-Type": "application/json"}
|
| 76 |
+
|
| 77 |
+
response = requests.post(API_URL, headers=headers, data=json.dumps(sample_payload))
|
| 78 |
+
|
| 79 |
+
print("Status Code:", response.status_code)
|
| 80 |
+
try:
|
| 81 |
+
print("Response:", json.dumps(response.json(), indent=2))
|
| 82 |
+
except Exception as e:
|
| 83 |
+
print("Error parsing response:", e)
|
| 84 |
+
print("Raw Response:", response.text)
|