antipluto 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. antipluto/__init__.py +34 -0
  2. antipluto/__main__.py +1232 -0
  3. antipluto/api/__init__.py +32 -0
  4. antipluto/api/app.py +239 -0
  5. antipluto/api/parser.py +89 -0
  6. antipluto/api/pipeline.py +102 -0
  7. antipluto/api/schemas.py +73 -0
  8. antipluto/api/service.py +218 -0
  9. antipluto/baseline/__init__.py +39 -0
  10. antipluto/baseline/clients.py +237 -0
  11. antipluto/baseline/evaluator.py +351 -0
  12. antipluto/baseline/mime_envelope.py +78 -0
  13. antipluto/baseline/unmasked_loader.py +174 -0
  14. antipluto/classifier/__init__.py +76 -0
  15. antipluto/classifier/benchmark.py +376 -0
  16. antipluto/classifier/data.py +214 -0
  17. antipluto/classifier/evaluator.py +178 -0
  18. antipluto/classifier/exporter.py +207 -0
  19. antipluto/classifier/heads/__init__.py +54 -0
  20. antipluto/classifier/heads/base.py +84 -0
  21. antipluto/classifier/heads/cnn_head.py +373 -0
  22. antipluto/classifier/heads/mlp_head.py +355 -0
  23. antipluto/classifier/heads/rf_head.py +159 -0
  24. antipluto/classifier/heads/xgboost_head.py +239 -0
  25. antipluto/classifier/semantic.py +286 -0
  26. antipluto/classifier/stylometric.py +136 -0
  27. antipluto/classifier/trainer.py +247 -0
  28. antipluto/configs/__init__.py +1 -0
  29. antipluto/configs/default.example.yaml +288 -0
  30. antipluto/generation/__init__.py +25 -0
  31. antipluto/generation/client.py +674 -0
  32. antipluto/generation/generator.py +588 -0
  33. antipluto/generation/prompts.py +285 -0
  34. antipluto/generation/provenance.py +249 -0
  35. antipluto/masking/__init__.py +1 -0
  36. antipluto/masking/masker.py +668 -0
  37. antipluto/preprocessing/__init__.py +9 -0
  38. antipluto/preprocessing/cleaners/__init__.py +1 -0
  39. antipluto/preprocessing/cleaners/feature_extractors.py +194 -0
  40. antipluto/preprocessing/cleaners/header_slicer.py +303 -0
  41. antipluto/preprocessing/cleaners/html_stripper.py +168 -0
  42. antipluto/preprocessing/cleaners/unicode_normalizer.py +172 -0
  43. antipluto/preprocessing/parsers/__init__.py +1 -0
  44. antipluto/preprocessing/parsers/base.py +361 -0
  45. antipluto/preprocessing/parsers/enron.py +247 -0
  46. antipluto/preprocessing/parsers/nazario.py +270 -0
  47. antipluto/preprocessing/parsers/nigerian_fraud.py +174 -0
  48. antipluto/preprocessing/parsers/spamassassin.py +294 -0
  49. antipluto/preprocessing/parsers/trec.py +327 -0
  50. antipluto/preprocessing/pipeline.py +380 -0
  51. antipluto/preprocessing/validators/__init__.py +1 -0
  52. antipluto/preprocessing/validators/schema.py +167 -0
  53. antipluto/utils/__init__.py +1 -0
  54. antipluto/utils/io.py +155 -0
  55. antipluto-1.0.0.dist-info/METADATA +256 -0
  56. antipluto-1.0.0.dist-info/RECORD +60 -0
  57. antipluto-1.0.0.dist-info/WHEEL +5 -0
  58. antipluto-1.0.0.dist-info/entry_points.txt +2 -0
  59. antipluto-1.0.0.dist-info/licenses/LICENSE +17 -0
  60. antipluto-1.0.0.dist-info/top_level.txt +1 -0
antipluto/__init__.py ADDED
@@ -0,0 +1,34 @@
1
+ """
2
+ antipluto
3
+ =======
4
+ Anti-PLUTO — Anti-Phishing Lexical Utilities and Threat Observation.
5
+
6
+ A modular, end-to-end Python framework for:
7
+
8
+ - Preprocessing raw email corpora into clean, schema-validated JSONL datasets.
9
+ - Anonymising PII via a two-stage MeAJOR-compatible masking pipeline.
10
+ - Generating LLM-assisted and LLM-generated email cohorts via OpenRouter.
11
+ - Training a dual-branch stylometric + semantic phishing classifier.
12
+ - Evaluating classifier performance against SpamAssassin / Rspamd baselines.
13
+ - Serving real-time phishing predictions via a FastAPI endpoint.
14
+
15
+ Academic Context
16
+ ----------------
17
+ MSc Computing Thesis — Dual-branch detection of LLM-generated phishing email.
18
+ (Stylometric TF-IDF + Semantic DeBERTaV3 → XGBoost)
19
+
20
+ Subpackages
21
+ -----------
22
+ antipluto.preprocessing Corpus ingestion, cleaning, and schema validation.
23
+ antipluto.masking Two-stage PII anonymisation (spaCy NER + regex).
24
+ antipluto.generation LLM cohort generation via OpenRouter API.
25
+ antipluto.classifier Dual-branch stylometric + semantic classifier.
26
+ antipluto.baseline SpamAssassin / Rspamd comparison harness.
27
+ antipluto.api FastAPI real-world prediction endpoint.
28
+ antipluto.utils Shared JSONL I/O utilities.
29
+
30
+ License: MIT
31
+ """
32
+
33
+ __version__ = "2.0.0"
34
+ __author__ = "Maarij"