Added extract_tags functionality to count key occurrences and pass frequency in a Counter object