Coming back to your goal, as you are doing for other things, I think clustering is always a great approach.
I just came accross a post by Dr. Blume and I think it should help in your aim:
https://sueden.social/@BlumeEvolution/113134900878353356
(German, but, hey...)
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.