From 0e8082140e5dfbc80d9171cc33b34a908579732a Mon Sep 17 00:00:00 2001 From: Anirudh Dagar Date: Wed, 6 May 2020 01:01:17 +0530 Subject: [PATCH 1/2] add steps run reccomendation --- recommendations/README.md | 28 ++++++++++++++++++++++- recommendations/cache_paper_embeddings.py | 5 +++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/recommendations/README.md b/recommendations/README.md index a41cd7dd8..badf3d141 100644 --- a/recommendations/README.md +++ b/recommendations/README.md @@ -1 +1,27 @@ -Run the recommendations code to produce a set of scores and recs. +Run the recommendations code to produce a set of scores and recs. +The model learns a `1024 dimensional embedding` corresponding to each paper based on the abstract data. + +## Setup & Usage + +#### Install git-lfs, required to download the saved model later. +```bash +#### Linux +apt-get install git-lfs + +#### MacOS +brew install git-lfs +``` + +```bash +git lfs install +rm -fr iclr.github.io +git clone https://github.com/ICLR/iclr.github.io +pip install -r iclr.github.io/requirements.txt +pip install -r iclr.github.io/recommendations/requirements.txt +``` + +To create the embeddings for the papers using the abstract information, run the following python script. + +```bash +python cache_paper_embeddings.py +``` \ No newline at end of file diff --git a/recommendations/cache_paper_embeddings.py b/recommendations/cache_paper_embeddings.py index 4b294e24a..8517eb052 100644 --- a/recommendations/cache_paper_embeddings.py +++ b/recommendations/cache_paper_embeddings.py @@ -8,7 +8,10 @@ from models import load_model import torch -accepted_submissions = pickle.load(open("../cached_or.pkl", "br")) +# accepted_submissions = pickle.load(open("../cached_or.pkl", "br")) + +with open("../sitedata/papers.json") as f: + accepted_submissions = json.load(f) # Load the model abstracts = [] From 08d5df1aedc6fc229245eb3c53565591a03c302b Mon Sep 17 00:00:00 2001 From: Anirudh Dagar Date: Wed, 6 May 2020 01:07:05 +0530 Subject: [PATCH 2/2] fix data path --- recommendations/cache_paper_embeddings.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/recommendations/cache_paper_embeddings.py b/recommendations/cache_paper_embeddings.py index 8517eb052..8b96491c5 100644 --- a/recommendations/cache_paper_embeddings.py +++ b/recommendations/cache_paper_embeddings.py @@ -8,10 +8,7 @@ from models import load_model import torch -# accepted_submissions = pickle.load(open("../cached_or.pkl", "br")) - -with open("../sitedata/papers.json") as f: - accepted_submissions = json.load(f) +accepted_submissions = pickle.load(open("../data/pkl/cached_or.pkl", "br")) # Load the model abstracts = []