Recommending documents to users based on keywords in the absence of interactions
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 724
- PR merge metrics
- No merged PRs in 30d
Description
I have a basic question about the use of lightFM, apologies if this isn't the right forum.
I'm building a recommender system that will recommend documents to users. There are no interactions yet and all we know about the users are the set of keywords they're interested in.
I've built a prototype where I transform each document using TF-IDF. I then transform the user's keywords with the same transformer and use cosine similarity to find the most relevant documents. It works reasonably well.
I'm now porting this to lightFM so that we can include interactions, but first I need the system to perform equally well as the TF-IDF solution, but I struggle to make it work. Here's the current approach:
1. build Dataset object on all items in the corpus, using TF-IDF to build item features
When request for recommendations for a new user comes in:
1. get that user’s keywords. Form a pseudo-document containing just a string with all the keywords.
1. get the TF-IDF features on that pseudo document, using the same vectorizer used to build the corpus features
1. retrain the LightFM model, with a single interaction between the user and the pseudo document and item_features formed by concatenating the corpus's item features and the pseudo document's features
1. call the predict function to get the recommendations
In my unit tests I have 52 documents, which get transformed to a TF-IDF vector of about 3300 columns. The user's pseudo document is transformed to a vector with a single 1.0 entry corresponding to that keyword.
So I would expect the prediction to score high those documents for which the TF-IDF entry corresponding to the keyword are also high. But instead, the scores are more or less the same, about -0.5.
Am I doing something wrong here?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository files or tests are named. Start by reviewing the described Dataset, TF-IDF item_features, retraining, and predict workflow, then reproduce the 52-document example and compare its scores with the expected keyword similarity; done means identifying whether the LightFM setup or the expectation is incorrect.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100