Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add news rec methods NAML NRMS NPA LSTUR #1080

Merged

Conversation

yjw1029
Copy link
Contributor

@yjw1029 yjw1029 commented Apr 2, 2020

Description

Add news rec methods (NAML NRMS NPA LSTUR)

Related Issues

#1079

Checklist:

  • I have followed the contribution guidelines and code style for this project.
  • I have added tests covering my contributions.
  • I have updated the documentation accordingly.
  • This PR is being made to staging and not master.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB.

@msftclas
Copy link

msftclas commented Apr 2, 2020

CLA assistant check
All CLA requirements met.

Copy link
Collaborator

@yueguoguo yueguoguo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the codes! In general it looks good to me. Just provided some minor comments.

Btw, the tests on Spark environment failed and I believe there is no Spark related code submitted in the PR, is that correct?

cc @miguelgfierro

README.md Outdated Show resolved Hide resolved
reco_utils/recommender/newsrec/IO/iterator.py Outdated Show resolved Hide resolved
@miguelgfierro miguelgfierro mentioned this pull request Apr 6, 2020
4 tasks
@miguelgfierro
Copy link
Collaborator

Btw, the tests on Spark environment failed and I believe there is no Spark related code submitted in the PR, is that correct?

Right now the test machines are down because of the measurements with covid in all MS. We will need to run the tests ourselves. I will add more folks to comment in the review

Copy link
Collaborator

@miguelgfierro miguelgfierro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a look, this is really impressive guys. My honest congratulations. It is absolutely awesome to be collaborating with you. Please send my regards to Xing.

reco_utils/recommender/newsrec/models/lstur.py Outdated Show resolved Hide resolved
reco_utils/recommender/newsrec/models/naml.py Outdated Show resolved Hide resolved
reco_utils/recommender/newsrec/models/naml.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@gramhagen gramhagen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice additions! I added some small suggestions / questions.

README.md Outdated
Comment on lines 59 to 63
| Neural News Recommendation with Long- and Short-term User Representations (LSTUR) | [Python CPU / Python GPU](notebooks/00_quick_start/lstur_synthetic.ipynb) | Content-Based Filtering | Deep learning news recommendation algorithm considering users' long- and short-term preference |
| Neural News Recommendation with Attentive Multi-View Learning (NAML) | [Python CPU / Python GPU](notebooks/00_quick_start/naml_synthetic.ipynb) | Content-Based Filtering | Deep learning news recommendation algorithm with multi-view learning |
| Neural Collaborative Filtering (NCF) | [Python CPU / Python GPU](notebooks/00_quick_start/ncf_movielens.ipynb) | Collaborative Filtering | Deep learning algorithm with enhanced performance for implicit feedback |
| Neural News Recommendation with Personalized Attention (NPA) | [Python CPU / Python GPU](notebooks/00_quick_start/npa_synthetic.ipynb) | Content-Based Filtering | Deep learning news recommendation algorithm ultilizing personalized attention |
| Neural News Recommendation with Multi-Head Self-Attention (NRMS) | [Python CPU / Python GPU](notebooks/00_quick_start/nrms_synthetic.ipynbb) | Content-Based Filtering | Deep learning news recommendation algorithm ultilizing multi-head self-attention |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the algorithms in this table are not domain specific. Is it important to have the news focus here? It may lead to people overlooking it as an option for other domains.

reco_utils/recommender/newsrec/IO/news_iterator.py Outdated Show resolved Hide resolved
return [imp_indexes, user_indexes, click_news_index_batch, candidate_news_index_batch], labels


class NewsTestIterator(BaseIterator):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the same as NewsTrainIterator with npratio=0? Do we need separate classes? Or can we extend that class to reduce redundant code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestions. I will try to change the code and combine these two iterators.

reco_utils/recommender/newsrec/IO/news_iterator.py Outdated Show resolved Hide resolved
reco_utils/recommender/newsrec/newsrec_utils.py Outdated Show resolved Hide resolved
reco_utils/recommender/newsrec/newsrec_utils.py Outdated Show resolved Hide resolved
tests/smoke/test_newsrec_model.py Outdated Show resolved Hide resolved
yjw1029 and others added 5 commits April 8, 2020 21:37
Co-Authored-By: Scott Graham <5720537+gramhagen@users.noreply.github.com>
Co-Authored-By: Scott Graham <5720537+gramhagen@users.noreply.github.com>
Co-Authored-By: Scott Graham <5720537+gramhagen@users.noreply.github.com>
README.md Outdated Show resolved Hide resolved
tests/unit/test_newsrec_model.py Outdated Show resolved Hide resolved
tests/smoke/test_newsrec_model.py Outdated Show resolved Hide resolved
tests/unit/test_newsrec_utils.py Outdated Show resolved Hide resolved
tests/unit/test_newsrec_utils.py Show resolved Hide resolved
@miguelgfierro
Copy link
Collaborator

hey @yjw1029 @yueguoguo @gramhagen @anargyri, just FYI, I run all the tests in Prometheus, new and old ones and everything passes

@yjw1029
Copy link
Contributor Author

yjw1029 commented Apr 23, 2020

hi @miguelgfierro. Thanks for your comment. I change the problems you mentioned above😁. Are there any issues in the code?

@miguelgfierro
Copy link
Collaborator

@yjw1029 from my part this is ready to go.

@gramhagen is there anything else that you would like to review?

@miguelgfierro
Copy link
Collaborator

after speaking with @gramhagen, I'll merge this.

@yjw1029 amazing work

@miguelgfierro miguelgfierro merged commit 10d90d8 into recommenders-team:staging Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants