SRK-CobuildX's picture
Release v0.1
14d406d verified
Raw History Blame Contribute Delete
1.24 kB
# Copyright 2026 Cobuild Tech Private Limited
# SPDX-License-Identifier: Apache-2.0
"""Run from the model folder: python example.py (every text below is invented for this example)"""
from cbx_phishing import PhishingDetector
clf = PhishingDetector(".")
texts = [
"Subject: Your mailbox is almost full\n\nDear user, your mailbox has reached 98% of its quota. Incoming messages will be rejected after 24 hours. Verify your account now to keep receiving mail: http://mail-quota-update.example-portal.com/verify",
"Subject: Re: Thursday planning meeting\n\nHi Priya, thanks for sending the draft. Can we move the meeting to 3 pm? I'll bring the budget numbers. Best, Tom",
"Subject: 40% off all garden furniture this weekend\n\nSpring sale! Save 40% on chairs, tables and parasols until Sunday. Free delivery on orders over $99. Shop now at gardenhouse-deals.example.com. Unsubscribe here.",
"Your parcel could not be delivered. Pay the $1.99 redelivery fee within 12 hours: https://parcel-redeliver.example.top/pay",
"Hey, are we still on for dinner tonight? I can pick you up at 7.",
]
for text, r in zip(texts, clf.classify(texts)):
print(f"{r['label']:<9} {max(r['scores'].values()):.2f} {' '.join(text.split())}")