Adam Ritter | rbr.bio's avatar
Adam Ritter | rbr.bio
aritter@iris.to
npub1dcl4...x5ey
Creator of rbr.bio and nostr-relaypool-ts
Adam Ritter | rbr.bio's avatar
aritter 2 years ago
Good news everyone! I added initial web worker support to RelayPool (called RelayPoolWorker). It provides smooth scrolling. You can try it at https://rbr.bio/ , but I'm sure it will get to Iris soon as well.
Adam Ritter | rbr.bio's avatar
aritter 2 years ago
My usual ranking update: I created and tested a weighted version of logistic regression, although I'm not sure that I wrote the right weighted Hessian (the logistic regression converged to the right solution with different weights). I made some API change where someone can add ,,only positive examples'', which makes it easyer to use for Nostr. Next step will be getting a few hundred liked events with their comments /likes and adding them as positive examples to the regression data set. Even though the implementation slowed down a bit, there's real progress happening every time I work on ranking. I hope in the next update I will be able to write what are the most imporant signals.
Adam Ritter | rbr.bio's avatar
aritter 2 years ago
While ranking training seems like to work now (except timing info :( ), for 1000 retrieved events I have 5 likes (rbr.io is retrieving lots more events than other clients because it shows all parent comments for now). I guess the solution will be to get liked events as well from the user's relays to get liked / non-liked training data ratio closer to 50% then reweight the liked events to have very small, but much more learnable weights. For example if 5 like events are exchanged to 100, the liked data should have 0.05 item weighting when training. Of course a modified Hessian for log likelihood needs to be computed for Newton-Ralph method for finding max log likelihood, so if somebody is good at math, they are welcome to help adding item weights to the computation :)
Adam Ritter | rbr.bio's avatar
aritter 2 years ago
Another update on ranking: I optimized the logistic regression a bit (it's about 8ms / iteration on 1000 events x 10 features). It could be made much faster, but I think it's fast enough, as Newton-Raphson method converges well. I also added the API for groups, so now the model learns if a user likes some event that somebody usually likes, and the user likes some event that a somebody publishes (experimenting with adding a ,,self like'' automatically would be interesting as well). Next steps are feature / model evaluation without using time, and then adding the time component (which is always a bit hacky, there's no real elegant solution). Also I separated ranking to a function so that it's easy to include into clients later: The current function call is this: function processEventForLogisticRegression( event: Event, logisticRegressor: LogisticRegressor, loggedInUser: string, parentEvent?: Event ) (the model can be trained and predictions for events retrieved later)
Adam Ritter | rbr.bio's avatar
aritter 2 years ago
Further update on my work on ranking: To make it easy to create a groups / categories of features (for example belonging to all different publishers), I'm planning to implement something like ,,feature groups'' in the logistic regression class that's responsible both for collecting training data and training / testing. As per GPT-4's suggestion, before training I'll put 2 (or maybe 3) features for each feature group : ratio of positive examples to total examples inside that group, and ratio of all examples in that group compared to total number of examples altogether. This will keep the features dense. The great thing with this decision is that for one more function in the logistic regression API surface (and a few more internal variables), the rendering code is kept simple: it just has to go through all events once to gather training data.
Adam Ritter | rbr.bio's avatar
aritter 2 years ago
I was talking more about ranking with a good friend who I know for a few months now, I thought it would be nice to share it here: https://shareg.pt/Kj5Vefo
Adam Ritter | rbr.bio's avatar
aritter 2 years ago
New change on https://rbr.bio again: log in with nostr extension to view followed notes (the old page is still available at https://us.rbr.bio). It looks more and more like a light client with showing likes by user and followed users, showing images. While I'll add the basic client features, what's imprtant is the for you tab, which will rearrange / collapse threads. I think my logistic regression library is working, but I need to add some time management (the ,,time passed'' feature is different for training than for inferencing).
Adam Ritter | rbr.bio's avatar
aritter 2 years ago
Now that #[0] launched nostr-relaypool-ts, and it's working great for retrieval, I started to focus on what I originally was interested in: ranking. So far it's in the planning stage, but I think it's going well. For now I'm planning on developing a pLike | note model (predicting whether a note is going to be liked by a user). I'm planning to use logistic regression with the following signals as a start: - time passed since note was created - note's author is followed by user - number of likes - number of comments - share of likes from the author by the user in the past - does it contain image? - does it contain link? - does it contain video? - text length - likes by followers Some are easier to implement, some are a bit harder, and of course I'll check their impact before launching them. I think I will order threads by the maximum probability that a note has in a thread. Also pLike can be used as a filter for comments to be shown / hidden. Of course pComment model can be trained on the same signal.
Adam Ritter | rbr.bio's avatar
aritter 2 years ago
I added the ,,show reply to a note if the note was replying to the same author functionality''. Next I need to implement replying (a basic login is already implemented), and then https://rbr.bio can be used as a light client for chatting :) Feel free to reply to my posts if you're interested in trying it out as a chat application :)
Adam Ritter | rbr.bio's avatar
aritter 2 years ago
New milestone in rbr.bio development: threading in the feed view of a person mostly works. Also view as is implemented for fun. The goal of the feed view was to be a simple, self contained, but flexible implementation that is able to recursively load all parent events, merge threads, reorder threads (right now based on newest timestamp in the thread that is shown). I'm planning to add minimal client features for playing with it better (like / reply / follow / login / maybe photos, make it super interactive, for example guarantee to show events from people that I replied to in a thread), but not planning to make it a client, as I'm more interested in creating a library for all clients that need feed support, which means that it has to be super flexible (showing comments, likes optional, recursive previous events optional, 100% customizable html / css). One more thing that *has* to be flexible is ranking: first I'm planning to play with ranking myself, but make sure it's pluggable as well. With generic timeline the ranking function is easy-to compose (just take the minimum / maximum score of 2 threads when merging 2 threads into 1), but I'm not totally opposed to having much more complex ranking functions as well if they make sense and practical (that need all events in a thread and other metadata to compute a ranking function). As I want to use Nostr as a Telegram / WhatsApp / HackerNews replacement for myself, my main ranking criteria will be the probablility that both I want to comment on a thread, and also I'm getting a comment reply. I know that many people care about likes / zaps, I care more about comments.