Ruby toolbox has a wonderfully simple way of crowdsourcing it -- categorizing a package is as simple as submitting a small yaml PR, e.g. https://github.com/rubytoolbox/catalog/pull/417/files
I think the challenge with that is that there's no standardization of categories. Both GitHub and npm have the concept of "topics/keywords" that developers can choose. Problem is that every maintainer chooses slightly different keywords, so it becomes ineffective as a tool for discovery.
We still haven't fully figured out what the optimal solution might be like.
Recommender system based on the kind of keywords in the description, starred project from main contributors etc