Semantic categorization using a hierarchical associative memory