| from __future__ import annotations | |
| from typing import List | |
| from shield.heuristics import check_spam_content | |
| from shield.models.evidence import Evidence | |
| _SCAM_MARKERS = ( | |
| "crypto giveaway", | |
| "wire transfer", | |
| "gift card", | |
| "urgent payment", | |
| "verify your wallet", | |
| ) | |
| def collect_content_evidence(content: str | None) -> List[Evidence]: | |
| if not content: | |
| return [] | |
| evidence: List[Evidence] = [] | |
| spam_reasons = check_spam_content(content) | |
| for reason in spam_reasons: | |
| evidence.append(Evidence( | |
| source="content_intelligence", | |
| category="spam", | |
| risk_score=42, | |
| weight=0.55, | |
| confidence=0.76, | |
| explanation=reason, | |
| )) | |
| lowered = content.lower() | |
| if any(marker in lowered for marker in _SCAM_MARKERS): | |
| evidence.append(Evidence( | |
| source="content_intelligence", | |
| category="scam", | |
| risk_score=58, | |
| weight=0.6, | |
| confidence=0.72, | |
| explanation="Content contains common scam or payment-abuse language", | |
| )) | |
| return evidence | |
Xet Storage Details
- Size:
- 1.13 kB
- Xet hash:
- 5e4da9cde1a9bba7e88a6c98c042ab92d756dfbe80a221e44883c08d10b39099
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.