Added categories() which returns a dictionary with index and categorized label.