Text this: Multi-phase dual-encoder model for anomaly detection in medical imaging