0
$\begingroup$

Context

I'm creating a social network.

The thing is, I don't want to order posts by likes, or something like that, I'm using an AI (lightfm in python). This AI uses a hybrid recommendation system based on ratings that users have given to posts.

For this part, everything works, BUT for testing I was using fake ratings that I've manually entered the database.

THE REAL QUESTION IS, how do I get the rating that a user has given to a post without asking him and only knowing his interactions (liked, shared, commented, watch time, etc...)

Interaction example:

{
    "average_watch_time": 2.4739250771067502,
    "follow_on_init": true,
    "id": 0,
    "interactions": [
        {
            "at": 1608370856,
            "id": 0,
            "type": "first_time"
        },
        {
            "at": 1608370860,
            "id": 1,
            "type": "see_profile"
        },
        {
            "at": 1608370861,
            "id": 2,
            "type": "come_back"
        },
        {
            "at": 1608370869,
            "id": 3,
            "type": "unfollow"
        },
        {
            "at": 1608370874,
            "id": 4,
            "type": "duo"
        },
        {
            "at": 1608370880,
            "id": 5,
            "type": "come_back"
        },
        {
            "at": 1608370890,
            "id": 6,
            "type": "double_click_like"
        },
        {
            "at": 1608370892,
            "id": 7,
            "type": "see_profile"
        },
        {
            "at": 1608370895,
            "id": 8,
            "type": "come_back"
        },
        {
            "at": 1608370900,
            "id": 9,
            "type": "copy_link"
        },
        {
            "at": 1608370907,
            "id": 10,
            "type": "duo"
        },
        {
            "at": 1608370911,
            "id": 11,
            "type": "come_back"
        },
        {
            "at": 1608370914,
            "id": 12,
            "type": "dislike"
        },
        {
            "at": 1608370924,
            "id": 13,
            "type": "see_profile"
        },
        {
            "at": 1608370934,
            "id": 14,
            "type": "come_back"
        }
    ],
    "total_comments": 2814,
    "total_duos": 78,
    "total_likes": 45477,
    "total_shares": 1857,
    "total_views": 4853,
    "video_duration": 0.48587760432015425
}

My solutions

First one

At the beginning, I thought the best solution was to rate on /20. And for each type of interaction (liked, commented, etc…), give it a part of this final grade. What I mean:

 Liked: /10;
 Commented: /2;
 Shared: /5;
 Followed: /3;
 Total: /20

The problems is that if I use this method it won't really work. For example if I share, that means that I liked the post but if I don't that doesn't necessarily mean that I didn't like it. SO THIS WILL REMOVE 5 points because I didn't share.

Second One

After that, I thought of making a deep RL algorithm based on human preferences.

The idea was that, I would create a client side website where a human can rate interactions. For this I created another algorithm that would create random interactions and then simulate them on the client side

BUT AFTER I WAS BLOCKED. Why ?

Well, because I SIMPLY DIDN'T KNOW HOW TO DO. There is nothing on the internet (except a really complex math document) on deep RL.

Third Solution

Finally, the last solution that I found was to give a weight to each type of interaction.

THE THING IS THAT, how could I give a weight to something that depends on other interactions (time between last interaction, repetition, video duration, etc...)

$\endgroup$
3
$\begingroup$

If I understood correctly, you will eventually have, after some time, those user ratings right? So, assuming that you will have some labeled data (i.e. user ratings together with the features you say) to train with, you can build a multivariate regression model (you can have a first look at linear models to begin with).

This approach is similar to what you have said in your option 3, where you would like to find ideal weights for each of your "attributes" (the features you said like shares, interaction time, comments...), and that is what you get by building that multivariate regression model:

linear regression

where the predicted value is the user rating you want, each of the x1, x2... are your features and the w1, w2... the weights you want to find.
This is a quick model type to train and easy to follow; later on, you can go on with a neural network or something el se more sophisticated in case you need it.

$\endgroup$
2
  • $\begingroup$ I don't really understand if a multivariate regression model is used to predict the rating or to get weights $\endgroup$ – johannb75 Dec 20 '20 at 12:25
  • $\begingroup$ Both, but for your use case, you can directly use it for estimating the rating (asuming you have a training dataset labeled with already known ratings) $\endgroup$ – German C M Dec 20 '20 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.