Filter papers by frequency relevance using multi-stage matching (band labels, frequency extraction, overlap). Use after retrieval to remove papers outside the target frequency range.
Multi-stage frequency-aware filtering that addresses the blind spot where paper titles/abstracts often don't mention specific frequencies.
from target_to_hypothesis.skills.frequency_filter import (
filter_papers_by_frequency,
freq_to_general_band,
extract_frequencies_from_text,
check_frequency_overlap,
)
# Get band labels for a frequency range
labels = freq_to_general_band(6.0, 14.0)
# ['microwave', 'C-band', 'X-band', 'Ku-band']
# Extract frequencies from text
freqs = extract_frequencies_from_text("absorber at 6.45 GHz and 14.89 GHz")
# [6.45, 14.89]
# Full multi-stage filter
results = filter_papers_by_frequency(
papers=candidates,
target_min_ghz=6.0,
target_max_ghz=14.0,
is_broadband=False,
)
D:/Claude/target_to_hypothesis/skills/frequency_filter.py