{"action":"created","comment":{"url":"https://api.github.com/repos/invitae/invitae-hanlab/pulls/comments/223451355","pull_request_review_id":162579691,"id":223451355,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzQ1MTM1NQ==","diff_hunk":"@@ -0,0 +1,36 @@\n+# Read papers and convert them to bag-of-words representations.\r\n+\r\n+indir = \"../data/raw/pubmed-txts-mf/\"\r\n+outdir = \"../data/processed/\"\r\n+from sklearn.feature_extraction.text import CountVectorizer\r\n+vectorizer = CountVectorizer()\r\n+import os\r\n+import numpy as np\r\n+import pickle\r\n+\r\n+# Read papers into a list\r\n+pmids = os.listdir(indir)\r\n+pmids.sort()\r\n+# pmids = pmids[:5]  # For debugging\r\n+corpus = [''] * len(pmids)\r","path":"bag_of_words/code/bag_of_words.py","position":15,"original_position":15,"commit_id":"c0767bc27940795a310acc9b7560bc6a9b22c263","original_commit_id":"c0767bc27940795a310acc9b7560bc6a9b22c263","user":{"login":"mattvitae","id":43144047,"node_id":"MDQ6VXNlcjQzMTQ0MDQ3","avatar_url":"https://avatars0.githubusercontent.com/u/43144047?v=4","gravatar_id":"","url":"https://api.github.com/users/mattvitae","html_url":"https://github.com/mattvitae","followers_url":"https://api.github.com/users/mattvitae/followers","following_url":"https://api.github.com/users/mattvitae/following{/other_user}","gists_url":"https://api.github.com/users/mattvitae/gists{/gist_id}","starred_url":"https://api.github.com/users/mattvitae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattvitae/subscriptions","organizations_url":"https://api.github.com/users/mattvitae/orgs","repos_url":"https://api.github.com/users/mattvitae/repos","events_url":"https://api.github.com/users/mattvitae/events{/privacy}","received_events_url":"https://api.github.com/users/mattvitae/received_events","type":"User","site_admin":false},"body":"Since we end up iterating over the PMID to build the corpus, and indexing by the PMID, I recommend using a dict of strings here instead of a list. That way, you can refer to the PMID as the dict key, and you don't need to keep a separate list of PMID.","created_at":"2018-10-08T18:03:49Z","updated_at":"2018-10-08T18:20:45Z","html_url":"https://github.com/invitae/invitae-hanlab/pull/2#discussion_r223451355","pull_request_url":"https://api.github.com/repos/invitae/invitae-hanlab/pulls/2","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/invitae/invitae-hanlab/pulls/comments/223451355"},"html":{"href":"https://github.com/invitae/invitae-hanlab/pull/2#discussion_r223451355"},"pull_request":{"href":"https://api.github.com/repos/invitae/invitae-hanlab/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/invitae/invitae-hanlab/pulls/2","id":220750865,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwNzUwODY1","html_url":"https://github.com/invitae/invitae-hanlab/pull/2","diff_url":"https://github.com/invitae/invitae-hanlab/pull/2.diff","patch_url":"https://github.com/invitae/invitae-hanlab/pull/2.patch","issue_url":"https://api.github.com/repos/invitae/invitae-hanlab/issues/2","number":2,"state":"open","locked":false,"title":"Bag of words","user":{"login":"JinfengXiao","id":12045329,"node_id":"MDQ6VXNlcjEyMDQ1MzI5","avatar_url":"https://avatars1.githubusercontent.com/u/12045329?v=4","gravatar_id":"","url":"https://api.github.com/users/JinfengXiao","html_url":"https://github.com/JinfengXiao","followers_url":"https://api.github.com/users/JinfengXiao/followers","following_url":"https://api.github.com/users/JinfengXiao/following{/other_user}","gists_url":"https://api.github.com/users/JinfengXiao/gists{/gist_id}","starred_url":"https://api.github.com/users/JinfengXiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JinfengXiao/subscriptions","organizations_url":"https://api.github.com/users/JinfengXiao/orgs","repos_url":"https://api.github.com/users/JinfengXiao/repos","events_url":"https://api.github.com/users/JinfengXiao/events{/privacy}","received_events_url":"https://api.github.com/users/JinfengXiao/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-05T16:02:30Z","updated_at":"2018-10-08T18:20:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24158c4a62b3cf3e05e49015cff70f3b5e6666bf","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/invitae/invitae-hanlab/pulls/2/commits","review_comments_url":"https://api.github.com/repos/invitae/invitae-hanlab/pulls/2/comments","review_comment_url":"https://api.github.com/repos/invitae/invitae-hanlab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/invitae/invitae-hanlab/issues/2/comments","statuses_url":"https://api.github.com/repos/invitae/invitae-hanlab/statuses/c0767bc27940795a310acc9b7560bc6a9b22c263","head":{"label":"invitae:bag_of_words","ref":"bag_of_words","sha":"c0767bc27940795a310acc9b7560bc6a9b22c263","user":{"login":"invitae","id":6261481,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyNjE0ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/6261481?v=4","gravatar_id":"","url":"https://api.github.com/users/invitae","html_url":"https://github.com/invitae","followers_url":"https://api.github.com/users/invitae/followers","following_url":"https://api.github.com/users/invitae/following{/other_user}","gists_url":"https://api.github.com/users/invitae/gists{/gist_id}","starred_url":"https://api.github.com/users/invitae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/invitae/subscriptions","organizations_url":"https://api.github.com/users/invitae/orgs","repos_url":"https://api.github.com/users/invitae/repos","events_url":"https://api.github.com/users/invitae/events{/privacy}","received_events_url":"https://api.github.com/users/invitae/received_events","type":"Organization","site_admin":false},"repo":{"id":149788071,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk3ODgwNzE=","name":"invitae-hanlab","full_name":"invitae/invitae-hanlab","private":false,"owner":{"login":"invitae","id":6261481,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyNjE0ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/6261481?v=4","gravatar_id":"","url":"https://api.github.com/users/invitae","html_url":"https://github.com/invitae","followers_url":"https://api.github.com/users/invitae/followers","following_url":"https://api.github.com/users/invitae/following{/other_user}","gists_url":"https://api.github.com/users/invitae/gists{/gist_id}","starred_url":"https://api.github.com/users/invitae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/invitae/subscriptions","organizations_url":"https://api.github.com/users/invitae/orgs","repos_url":"https://api.github.com/users/invitae/repos","events_url":"https://api.github.com/users/invitae/events{/privacy}","received_events_url":"https://api.github.com/users/invitae/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/invitae/invitae-hanlab","description":null,"fork":false,"url":"https://api.github.com/repos/invitae/invitae-hanlab","forks_url":"https://api.github.com/repos/invitae/invitae-hanlab/forks","keys_url":"https://api.github.com/repos/invitae/invitae-hanlab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/invitae/invitae-hanlab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/invitae/invitae-hanlab/teams","hooks_url":"https://api.github.com/repos/invitae/invitae-hanlab/hooks","issue_events_url":"https://api.github.com/repos/invitae/invitae-hanlab/issues/events{/number}","events_url":"https://api.github.com/repos/invitae/invitae-hanlab/events","assignees_url":"https://api.github.com/repos/invitae/invitae-hanlab/assignees{/user}","branches_url":"https://api.github.com/repos/invitae/invitae-hanlab/branches{/branch}","tags_url":"https://api.github.com/repos/invitae/invitae-hanlab/tags","blobs_url":"https://api.github.com/repos/invitae/invitae-hanlab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/invitae/invitae-hanlab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/invitae/invitae-hanlab/git/refs{/sha}","trees_url":"https://api.github.com/repos/invitae/invitae-hanlab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/invitae/invitae-hanlab/statuses/{sha}","languages_url":"https://api.github.com/repos/invitae/invitae-hanlab/languages","stargazers_url":"https://api.github.com/repos/invitae/invitae-hanlab/stargazers","contributors_url":"https://api.github.com/repos/invitae/invitae-hanlab/contributors","subscribers_url":"https://api.github.com/repos/invitae/invitae-hanlab/subscribers","subscription_url":"https://api.github.com/repos/invitae/invitae-hanlab/subscription","commits_url":"https://api.github.com/repos/invitae/invitae-hanlab/commits{/sha}","git_commits_url":"https://api.github.com/repos/invitae/invitae-hanlab/git/commits{/sha}","comments_url":"https://api.github.com/repos/invitae/invitae-hanlab/comments{/number}","issue_comment_url":"https://api.github.com/repos/invitae/invitae-hanlab/issues/comments{/number}","contents_url":"https://api.github.com/repos/invitae/invitae-hanlab/contents/{+path}","compare_url":"https://api.github.com/repos/invitae/invitae-hanlab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/invitae/invitae-hanlab/merges","archive_url":"https://api.github.com/repos/invitae/invitae-hanlab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/invitae/invitae-hanlab/downloads","issues_url":"https://api.github.com/repos/invitae/invitae-hanlab/issues{/number}","pulls_url":"https://api.github.com/repos/invitae/invitae-hanlab/pulls{/number}","milestones_url":"https://api.github.com/repos/invitae/invitae-hanlab/milestones{/number}","notifications_url":"https://api.github.com/repos/invitae/invitae-hanlab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/invitae/invitae-hanlab/labels{/name}","releases_url":"https://api.github.com/repos/invitae/invitae-hanlab/releases{/id}","deployments_url":"https://api.github.com/repos/invitae/invitae-hanlab/deployments","created_at":"2018-09-21T16:14:14Z","updated_at":"2018-10-03T20:17:00Z","pushed_at":"2018-10-05T16:02:30Z","git_url":"git://github.com/invitae/invitae-hanlab.git","ssh_url":"git@github.com:invitae/invitae-hanlab.git","clone_url":"https://github.com/invitae/invitae-hanlab.git","svn_url":"https://github.com/invitae/invitae-hanlab","homepage":null,"size":49,"stargazers_count":0,"watchers_count":0,"language":"Dockerfile","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"invitae:master","ref":"master","sha":"6cf54ac3b73d89c04698136af301cfcf5705b51d","user":{"login":"invitae","id":6261481,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyNjE0ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/6261481?v=4","gravatar_id":"","url":"https://api.github.com/users/invitae","html_url":"https://github.com/invitae","followers_url":"https://api.github.com/users/invitae/followers","following_url":"https://api.github.com/users/invitae/following{/other_user}","gists_url":"https://api.github.com/users/invitae/gists{/gist_id}","starred_url":"https://api.github.com/users/invitae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/invitae/subscriptions","organizations_url":"https://api.github.com/users/invitae/orgs","repos_url":"https://api.github.com/users/invitae/repos","events_url":"https://api.github.com/users/invitae/events{/privacy}","received_events_url":"https://api.github.com/users/invitae/received_events","type":"Organization","site_admin":false},"repo":{"id":149788071,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk3ODgwNzE=","name":"invitae-hanlab","full_name":"invitae/invitae-hanlab","private":false,"owner":{"login":"invitae","id":6261481,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyNjE0ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/6261481?v=4","gravatar_id":"","url":"https://api.github.com/users/invitae","html_url":"https://github.com/invitae","followers_url":"https://api.github.com/users/invitae/followers","following_url":"https://api.github.com/users/invitae/following{/other_user}","gists_url":"https://api.github.com/users/invitae/gists{/gist_id}","starred_url":"https://api.github.com/users/invitae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/invitae/subscriptions","organizations_url":"https://api.github.com/users/invitae/orgs","repos_url":"https://api.github.com/users/invitae/repos","events_url":"https://api.github.com/users/invitae/events{/privacy}","received_events_url":"https://api.github.com/users/invitae/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/invitae/invitae-hanlab","description":null,"fork":false,"url":"https://api.github.com/repos/invitae/invitae-hanlab","forks_url":"https://api.github.com/repos/invitae/invitae-hanlab/forks","keys_url":"https://api.github.com/repos/invitae/invitae-hanlab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/invitae/invitae-hanlab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/invitae/invitae-hanlab/teams","hooks_url":"https://api.github.com/repos/invitae/invitae-hanlab/hooks","issue_events_url":"https://api.github.com/repos/invitae/invitae-hanlab/issues/events{/number}","events_url":"https://api.github.com/repos/invitae/invitae-hanlab/events","assignees_url":"https://api.github.com/repos/invitae/invitae-hanlab/assignees{/user}","branches_url":"https://api.github.com/repos/invitae/invitae-hanlab/branches{/branch}","tags_url":"https://api.github.com/repos/invitae/invitae-hanlab/tags","blobs_url":"https://api.github.com/repos/invitae/invitae-hanlab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/invitae/invitae-hanlab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/invitae/invitae-hanlab/git/refs{/sha}","trees_url":"https://api.github.com/repos/invitae/invitae-hanlab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/invitae/invitae-hanlab/statuses/{sha}","languages_url":"https://api.github.com/repos/invitae/invitae-hanlab/languages","stargazers_url":"https://api.github.com/repos/invitae/invitae-hanlab/stargazers","contributors_url":"https://api.github.com/repos/invitae/invitae-hanlab/contributors","subscribers_url":"https://api.github.com/repos/invitae/invitae-hanlab/subscribers","subscription_url":"https://api.github.com/repos/invitae/invitae-hanlab/subscription","commits_url":"https://api.github.com/repos/invitae/invitae-hanlab/commits{/sha}","git_commits_url":"https://api.github.com/repos/invitae/invitae-hanlab/git/commits{/sha}","comments_url":"https://api.github.com/repos/invitae/invitae-hanlab/comments{/number}","issue_comment_url":"https://api.github.com/repos/invitae/invitae-hanlab/issues/comments{/number}","contents_url":"https://api.github.com/repos/invitae/invitae-hanlab/contents/{+path}","compare_url":"https://api.github.com/repos/invitae/invitae-hanlab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/invitae/invitae-hanlab/merges","archive_url":"https://api.github.com/repos/invitae/invitae-hanlab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/invitae/invitae-hanlab/downloads","issues_url":"https://api.github.com/repos/invitae/invitae-hanlab/issues{/number}","pulls_url":"https://api.github.com/repos/invitae/invitae-hanlab/pulls{/number}","milestones_url":"https://api.github.com/repos/invitae/invitae-hanlab/milestones{/number}","notifications_url":"https://api.github.com/repos/invitae/invitae-hanlab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/invitae/invitae-hanlab/labels{/name}","releases_url":"https://api.github.com/repos/invitae/invitae-hanlab/releases{/id}","deployments_url":"https://api.github.com/repos/invitae/invitae-hanlab/deployments","created_at":"2018-09-21T16:14:14Z","updated_at":"2018-10-03T20:17:00Z","pushed_at":"2018-10-05T16:02:30Z","git_url":"git://github.com/invitae/invitae-hanlab.git","ssh_url":"git@github.com:invitae/invitae-hanlab.git","clone_url":"https://github.com/invitae/invitae-hanlab.git","svn_url":"https://github.com/invitae/invitae-hanlab","homepage":null,"size":49,"stargazers_count":0,"watchers_count":0,"language":"Dockerfile","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/invitae/invitae-hanlab/pulls/2"},"html":{"href":"https://github.com/invitae/invitae-hanlab/pull/2"},"issue":{"href":"https://api.github.com/repos/invitae/invitae-hanlab/issues/2"},"comments":{"href":"https://api.github.com/repos/invitae/invitae-hanlab/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/invitae/invitae-hanlab/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/invitae/invitae-hanlab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/invitae/invitae-hanlab/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/invitae/invitae-hanlab/statuses/c0767bc27940795a310acc9b7560bc6a9b22c263"}},"author_association":"NONE"}}
{"actor":{"display_login":"mattvitae"}}