Minor optimizations and adding relevance threshold for actually generating a classification