---
name: filter-ai
description: Classify articles as AI-related or not using keyword matching
  and Claude batch review. Reads raw news, outputs filtered AI articles.
argument-hint: <date_str>
model: haiku
---

# Filter AI Relevance

Classify whether articles are related to Artificial Intelligence using a
two-phase approach: rule-based keyword pre-filter (high confidence) and
Claude batch classification (borderline cases).

## Steps
1. Load raw news from `data/raw/raw_news_<date_str>.json`
2. Run rule-based keyword matching for high-confidence classification
   - Chinese keywords from `config.yaml` (36 keywords)
   - English keywords from `config.yaml` (29 keywords)
3. Borderline articles (single keyword match, score 0.3-0.7) get Claude review
4. Use `prompts/filter.txt` for the classification prompt
5. Process borderlines in batches of 5 (anti-dump)
6. Sort by relevance score descending
7. Save to `data/filtered/filtered_news_<date_str>.json`

## Batch Processing (Anti-Dump)
- Confident matches (>0.7 score): classify directly, no Claude needed
- Borderline cases: send to Claude in batches of 5 max
- Each Claude call uses `prompts/filter.txt`
