How would I add a new ranking algorithm to Lemmy as a contributor? I’m a developer by trade, but unfamiliar with Rust and the codebase of Lemmy specifically. It doesn’t seem like Lemmy has a concept of ‘ranking plugins’, so whatever I do would have to involve an MR.

Specifically, I’d like to introduce a ranking system that approximates Proportional Approval Voting, specifically using Thiele’s elimination methods, like is used in LiquidFeedback.

I’m pretty sure that with a few tweaks to Thiele’s rules, I can compute a complete ranking of all comments in a thread in O(ClogC + E + VlogC), where C is the number of comments, E is the total number of likes, and V is the number of users. This would also support partial approvals, upvotes could decay with age.

I believe this would mitigate the tendency towards echo chambers that Lemmy inherits from Reddit. Lemmy effectively uses Block Approval Voting with decays to rank comments and posts, leading to the same people dominating every conversation.

  • CrashLoopBackOff@lemmy.caOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    19 hours ago

    I don’t think it would work for my specific algorithm, unfortunately. To compute PAV, I need access to the “raw votes” of each individual user.

    PAV doesn’t need to know the identity of the user behind each upvote, but it does need to be able to correlate which upvotes originated from the same user so that once a user is determined to be “satisfied” by having a comment they upvoted given a high rank, all of their other upvotes need to be deweighted for the remainder of the process to “make room” for other users’ opinions.

    I checked the Lemmy API docs, and while that information is available at /api/v4/post/like/list and /api/v4/comment/like/list, so I could have a frontend that scraped every comment and then every like of every comment in a community (ignoring how inefficient that would be), but both of those endpoints are tagged as “Admin-only”.

    Plus, even if I could do that, to compute the rankings my process does need the upvotes of every comment in a post (or every post in a community) before it knows which one is on top, which seems too much to put on a client.

    • rglullis@communick.news
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      19 hours ago

      so I could have a frontend that scraped every comment and then every like of every comment in a community

      Or you could do the same thing that https://lemvotes.org/ does and follow the communities and actors to build this database on a separate server, which then can be used by the client(s).