TamAko783/filipino-scam-final-shards
Filipino Scam — Final Shards CoT-formatted pickle shards for Qwen3-VL-4B-Instruct LoRA fine-tuning on Filipino short-form video scam detection. This is the final, training-ready format used to build TamAko783/Scam-Qwen3-VL-4B-final-lora. Splits File Samples Purpose Training.pkl 1600 Training set Validate.pkl 198 Validation (early stopping + best-checkpoint selection) Evaluate.pkl 202 Held-out test (final unbiased metrics) Both Validate and… See the full description on the dataset page: https://huggingface.co/datasets/TamAko783/filipino-scam-final-shards.
Filipino Scam — Final Shards
CoT-formatted pickle shards for Qwen3-VL-4B-Instruct LoRA fine-tuning on Filipino short-form video scam detection. This is the final, training-ready format used to build TamAko783/Scam-Qwen3-VL-4B-final-lora.
Splits
Both Validate and Evaluate are stratified halves of the original Kaggle test split, balanced 50/50 yes/no within every category (crypto, ewallet, giftcard, giveaway, p2e, task) using seed=42.
Format (one pickle.dump per sample)
{
"id": "youtube_<id>", # original video id
"platform": "tiktok|youtube|fb",
"category": "crypto|ewallet|giftcard|giveaway|p2e|task",
"label": "legitimate|scam",
"messages": [
{"role": "system", "content": [{"type":"text", "text": "<scam-policy + Philippine context>"}]},
{"role": "user", "content": [
{"type": "image", "image": <PIL.Image>}, # 33-60 frames, RGB
...,
{"type": "text", "text": "[Audio Transcript]\n... \nTitle: ...\nDescription: ...\n\nReason inside <think>...</think> tags ..."},
]},
{"role": "assistant", "content": [{"type":"text", "text": "<assistant CoT target — see below>"}]},
],
}Cleaning applied
- OCR Temporal Text block stripped — was per-second one-word fragments with frequent misreads, ~600 tokens/sample of pure noise.
<image>placeholder tokens replaced with PIL Image entries in the user-content list.<think>instruction appended to user prompt.- Assistant target reformatted into V8 Chain-of-Thought-with-think structure (below).
V8 CoT-with-think assistant target format (DeepSeek-R1 style)
<think>
Evidence: <single-line observation derived from frames + audio + title/description>
Criteria hits (C1-C7): <list of Cx hits with reasoning, or "none">
</think>
{"verdict": "Yes", "confidence": 0.95, "category": "Crypto Investment"}Why this format — research-backed:
- Reasoning genuinely conditions the verdict (real CoT, not post-hoc rationalization) — Anthropic 2023/2025 faithfulness papers, RFEval 2026.
- `</think>` is a hard syntactic boundary — the model learns to emit it reliably, which prevents the rationale-repetition collapse that kills naive verdict-last formats.
- JSON output is bulletproof to parse even if the think block goes off-rails — 4-tier robust parser handles all failure modes.
- Schema matches Qwen3-VL-Thinking's native template — minimal distribution shift on small datasets.
Parsing
import re, json
JSON_VERDICT_RE = re.compile(r'"verdict"\s*:\s*"(Yes|No)"', re.IGNORECASE)
LEGACY_RE = re.compile(r'(?:Scam\s*)?Verdict\s*:\s*(Yes|No)\b', re.IGNORECASE)
FALLBACK_RE = re.compile(r'\b(Yes|No)\b', re.IGNORECASE)
def parse_verdict(text):
text_after = text.split('</think>', 1)[1] if '</think>' in text else text
for r in (JSON_VERDICT_RE, LEGACY_RE, FALLBACK_RE):
m = r.search(text_after) or r.search(text)
if m: return m.group(1).lower()
return NoneSource
Built from the Kaggle Filipino scam dataset (Training.jsonl + Validate.jsonl + Evaluate.jsonl) using prepare_data.py.
