{"action":"created","comment":{"url":"https://api.github.com/repos/facebookresearch/ParlAI/pulls/comments/207317204","pull_request_review_id":142905553,"id":207317204,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNzMxNzIwNA==","diff_hunk":"@@ -20,12 +20,37 @@\n \n import os\n import json\n+import random\n \n # There is no real dialog in this task, so for the purposes of display_data, we\n # include a generic question that applies to all images.\n QUESTION = \"Describe the above picture in a sentence.\"\n \n \n+def load_candidates(datapath, version):\n+    suffix = 'captions_{}{}.json'\n+\n+    suffix_val = suffix.format('val', version)\n+    suffix_train = suffix.format('train', version)\n+\n+    val_path = os.path.join(datapath,\n+                            'COCO_{}_Caption'.format(version),\n+                            'annotations',\n+                            suffix_val)\n+    train_path = os.path.join(datapath,\n+                              'COCO_{}_Caption'.format(version),\n+                              'annotations',\n+                              suffix_train)\n+\n+    val = json.load(open(val_path))['annotations']\n+    train = json.load(open(train_path))['annotations']\n+\n+    val_caps = [x['caption'] for x in val]\n+    train_caps = [x['caption'] for x in train]\n+\n+    return train_caps + val_caps, val_caps","path":"parlai/tasks/coco_caption/agents.py","position":32,"original_position":32,"commit_id":"bf1515684d1dbb5014083c179248880b9aa71a20","original_commit_id":"5e9017d15d16758b8f5cf5c9a8e1c3f9602e179e","user":{"login":"alexholdenmiller","id":1141354,"node_id":"MDQ6VXNlcjExNDEzNTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1141354?v=4","gravatar_id":"","url":"https://api.github.com/users/alexholdenmiller","html_url":"https://github.com/alexholdenmiller","followers_url":"https://api.github.com/users/alexholdenmiller/followers","following_url":"https://api.github.com/users/alexholdenmiller/following{/other_user}","gists_url":"https://api.github.com/users/alexholdenmiller/gists{/gist_id}","starred_url":"https://api.github.com/users/alexholdenmiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexholdenmiller/subscriptions","organizations_url":"https://api.github.com/users/alexholdenmiller/orgs","repos_url":"https://api.github.com/users/alexholdenmiller/repos","events_url":"https://api.github.com/users/alexholdenmiller/events{/privacy}","received_events_url":"https://api.github.com/users/alexholdenmiller/received_events","type":"User","site_admin":false},"body":"I'm unsure of this still :) I'll ask in person","created_at":"2018-08-02T17:52:32Z","updated_at":"2018-08-02T17:53:26Z","html_url":"https://github.com/facebookresearch/ParlAI/pull/966#discussion_r207317204","pull_request_url":"https://api.github.com/repos/facebookresearch/ParlAI/pulls/966","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/facebookresearch/ParlAI/pulls/comments/207317204"},"html":{"href":"https://github.com/facebookresearch/ParlAI/pull/966#discussion_r207317204"},"pull_request":{"href":"https://api.github.com/repos/facebookresearch/ParlAI/pulls/966"}},"in_reply_to_id":203120639},"pull_request":{"url":"https://api.github.com/repos/facebookresearch/ParlAI/pulls/966","id":200200178,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwMjAwMTc4","html_url":"https://github.com/facebookresearch/ParlAI/pull/966","diff_url":"https://github.com/facebookresearch/ParlAI/pull/966.diff","patch_url":"https://github.com/facebookresearch/ParlAI/pull/966.patch","issue_url":"https://api.github.com/repos/facebookresearch/ParlAI/issues/966","number":966,"state":"open","locked":false,"title":"Add Caption Retrieval Model","user":{"login":"vgonzalez88","id":26659520,"node_id":"MDQ6VXNlcjI2NjU5NTIw","avatar_url":"https://avatars3.githubusercontent.com/u/26659520?v=4","gravatar_id":"","url":"https://api.github.com/users/vgonzalez88","html_url":"https://github.com/vgonzalez88","followers_url":"https://api.github.com/users/vgonzalez88/followers","following_url":"https://api.github.com/users/vgonzalez88/following{/other_user}","gists_url":"https://api.github.com/users/vgonzalez88/gists{/gist_id}","starred_url":"https://api.github.com/users/vgonzalez88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vgonzalez88/subscriptions","organizations_url":"https://api.github.com/users/vgonzalez88/orgs","repos_url":"https://api.github.com/users/vgonzalez88/repos","events_url":"https://api.github.com/users/vgonzalez88/events{/privacy}","received_events_url":"https://api.github.com/users/vgonzalez88/received_events","type":"User","site_admin":false},"body":"Add a retrieval model for image captioning. The model architecture is used in [this paper](https://arxiv.org/abs/1707.05612), \"VSE++: Improving Visual-Semantic Embeddings with Hard Negatives\".\r\n\r\nNotable Metrics:\r\n-\r\n- Paper (on 1k test images)\r\n  - (VSE++ w/Resnet) R@1: 58.3, R@10: 93.3 \r\n  - (VSE0 w/Resnet) R@1: 52.7, R@10: 91.8\r\n- Our Model (on 202k validation examples)\r\n  - (VSE++ w/Resnet) R@1: 51.9, R@5: 86.6, R@10: 93.1\r\n  - (VSE0 w/Resnet) R@1: 50.7, R@5: 85.8, R@10: 92.6\r\n\r\nPossible Reasons for Discrepancy (in order of likely importance):\r\n1. The paper takes 30k images from the validation set incorporates them into the train set, we do not\r\n2. The paper tests on fewer total examples\r\n3. Counterpoint: We sample 149 random captions + 1 truth for each validation example while the paper uses all 1k captions each time.\r\n4. The paper is providing numbers for test images while we use validation images","created_at":"2018-07-09T19:44:10Z","updated_at":"2018-08-02T17:53:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da039ae51dba6486c609753fdb960c6c4ef3db7c","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jaseweston","id":11068664,"node_id":"MDQ6VXNlcjExMDY4NjY0","avatar_url":"https://avatars3.githubusercontent.com/u/11068664?v=4","gravatar_id":"","url":"https://api.github.com/users/jaseweston","html_url":"https://github.com/jaseweston","followers_url":"https://api.github.com/users/jaseweston/followers","following_url":"https://api.github.com/users/jaseweston/following{/other_user}","gists_url":"https://api.github.com/users/jaseweston/gists{/gist_id}","starred_url":"https://api.github.com/users/jaseweston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaseweston/subscriptions","organizations_url":"https://api.github.com/users/jaseweston/orgs","repos_url":"https://api.github.com/users/jaseweston/repos","events_url":"https://api.github.com/users/jaseweston/events{/privacy}","received_events_url":"https://api.github.com/users/jaseweston/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":590886701,"node_id":"MDU6TGFiZWw1OTA4ODY3MDE=","url":"https://api.github.com/repos/facebookresearch/ParlAI/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/facebookresearch/ParlAI/pulls/966/commits","review_comments_url":"https://api.github.com/repos/facebookresearch/ParlAI/pulls/966/comments","review_comment_url":"https://api.github.com/repos/facebookresearch/ParlAI/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebookresearch/ParlAI/issues/966/comments","statuses_url":"https://api.github.com/repos/facebookresearch/ParlAI/statuses/bf1515684d1dbb5014083c179248880b9aa71a20","head":{"label":"facebookresearch:add_retrieval_caption","ref":"add_retrieval_caption","sha":"bf1515684d1dbb5014083c179248880b9aa71a20","user":{"login":"facebookresearch","id":16943930,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2OTQzOTMw","avatar_url":"https://avatars0.githubusercontent.com/u/16943930?v=4","gravatar_id":"","url":"https://api.github.com/users/facebookresearch","html_url":"https://github.com/facebookresearch","followers_url":"https://api.github.com/users/facebookresearch/followers","following_url":"https://api.github.com/users/facebookresearch/following{/other_user}","gists_url":"https://api.github.com/users/facebookresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/facebookresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebookresearch/subscriptions","organizations_url":"https://api.github.com/users/facebookresearch/orgs","repos_url":"https://api.github.com/users/facebookresearch/repos","events_url":"https://api.github.com/users/facebookresearch/events{/privacy}","received_events_url":"https://api.github.com/users/facebookresearch/received_events","type":"Organization","site_admin":false},"repo":{"id":89266735,"node_id":"MDEwOlJlcG9zaXRvcnk4OTI2NjczNQ==","name":"ParlAI","full_name":"facebookresearch/ParlAI","owner":{"login":"facebookresearch","id":16943930,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2OTQzOTMw","avatar_url":"https://avatars0.githubusercontent.com/u/16943930?v=4","gravatar_id":"","url":"https://api.github.com/users/facebookresearch","html_url":"https://github.com/facebookresearch","followers_url":"https://api.github.com/users/facebookresearch/followers","following_url":"https://api.github.com/users/facebookresearch/following{/other_user}","gists_url":"https://api.github.com/users/facebookresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/facebookresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebookresearch/subscriptions","organizations_url":"https://api.github.com/users/facebookresearch/orgs","repos_url":"https://api.github.com/users/facebookresearch/repos","events_url":"https://api.github.com/users/facebookresearch/events{/privacy}","received_events_url":"https://api.github.com/users/facebookresearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebookresearch/ParlAI","description":"A framework for training and evaluating AI models on a variety of openly available dialog datasets.","fork":false,"url":"https://api.github.com/repos/facebookresearch/ParlAI","forks_url":"https://api.github.com/repos/facebookresearch/ParlAI/forks","keys_url":"https://api.github.com/repos/facebookresearch/ParlAI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebookresearch/ParlAI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebookresearch/ParlAI/teams","hooks_url":"https://api.github.com/repos/facebookresearch/ParlAI/hooks","issue_events_url":"https://api.github.com/repos/facebookresearch/ParlAI/issues/events{/number}","events_url":"https://api.github.com/repos/facebookresearch/ParlAI/events","assignees_url":"https://api.github.com/repos/facebookresearch/ParlAI/assignees{/user}","branches_url":"https://api.github.com/repos/facebookresearch/ParlAI/branches{/branch}","tags_url":"https://api.github.com/repos/facebookresearch/ParlAI/tags","blobs_url":"https://api.github.com/repos/facebookresearch/ParlAI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebookresearch/ParlAI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebookresearch/ParlAI/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebookresearch/ParlAI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebookresearch/ParlAI/statuses/{sha}","languages_url":"https://api.github.com/repos/facebookresearch/ParlAI/languages","stargazers_url":"https://api.github.com/repos/facebookresearch/ParlAI/stargazers","contributors_url":"https://api.github.com/repos/facebookresearch/ParlAI/contributors","subscribers_url":"https://api.github.com/repos/facebookresearch/ParlAI/subscribers","subscription_url":"https://api.github.com/repos/facebookresearch/ParlAI/subscription","commits_url":"https://api.github.com/repos/facebookresearch/ParlAI/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebookresearch/ParlAI/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebookresearch/ParlAI/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebookresearch/ParlAI/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebookresearch/ParlAI/contents/{+path}","compare_url":"https://api.github.com/repos/facebookresearch/ParlAI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebookresearch/ParlAI/merges","archive_url":"https://api.github.com/repos/facebookresearch/ParlAI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebookresearch/ParlAI/downloads","issues_url":"https://api.github.com/repos/facebookresearch/ParlAI/issues{/number}","pulls_url":"https://api.github.com/repos/facebookresearch/ParlAI/pulls{/number}","milestones_url":"https://api.github.com/repos/facebookresearch/ParlAI/milestones{/number}","notifications_url":"https://api.github.com/repos/facebookresearch/ParlAI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebookresearch/ParlAI/labels{/name}","releases_url":"https://api.github.com/repos/facebookresearch/ParlAI/releases{/id}","deployments_url":"https://api.github.com/repos/facebookresearch/ParlAI/deployments","created_at":"2017-04-24T17:10:44Z","updated_at":"2018-08-02T17:49:30Z","pushed_at":"2018-08-02T17:49:28Z","git_url":"git://github.com/facebookresearch/ParlAI.git","ssh_url":"git@github.com:facebookresearch/ParlAI.git","clone_url":"https://github.com/facebookresearch/ParlAI.git","svn_url":"https://github.com/facebookresearch/ParlAI","homepage":"parl.ai","size":11766,"stargazers_count":3514,"watchers_count":3514,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":620,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":620,"open_issues":21,"watchers":3514,"default_branch":"master"}},"base":{"label":"facebookresearch:master","ref":"master","sha":"58ac4e87c577beb2c99dfb89fa054c1a20c90cc4","user":{"login":"facebookresearch","id":16943930,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2OTQzOTMw","avatar_url":"https://avatars0.githubusercontent.com/u/16943930?v=4","gravatar_id":"","url":"https://api.github.com/users/facebookresearch","html_url":"https://github.com/facebookresearch","followers_url":"https://api.github.com/users/facebookresearch/followers","following_url":"https://api.github.com/users/facebookresearch/following{/other_user}","gists_url":"https://api.github.com/users/facebookresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/facebookresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebookresearch/subscriptions","organizations_url":"https://api.github.com/users/facebookresearch/orgs","repos_url":"https://api.github.com/users/facebookresearch/repos","events_url":"https://api.github.com/users/facebookresearch/events{/privacy}","received_events_url":"https://api.github.com/users/facebookresearch/received_events","type":"Organization","site_admin":false},"repo":{"id":89266735,"node_id":"MDEwOlJlcG9zaXRvcnk4OTI2NjczNQ==","name":"ParlAI","full_name":"facebookresearch/ParlAI","owner":{"login":"facebookresearch","id":16943930,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2OTQzOTMw","avatar_url":"https://avatars0.githubusercontent.com/u/16943930?v=4","gravatar_id":"","url":"https://api.github.com/users/facebookresearch","html_url":"https://github.com/facebookresearch","followers_url":"https://api.github.com/users/facebookresearch/followers","following_url":"https://api.github.com/users/facebookresearch/following{/other_user}","gists_url":"https://api.github.com/users/facebookresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/facebookresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebookresearch/subscriptions","organizations_url":"https://api.github.com/users/facebookresearch/orgs","repos_url":"https://api.github.com/users/facebookresearch/repos","events_url":"https://api.github.com/users/facebookresearch/events{/privacy}","received_events_url":"https://api.github.com/users/facebookresearch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebookresearch/ParlAI","description":"A framework for training and evaluating AI models on a variety of openly available dialog datasets.","fork":false,"url":"https://api.github.com/repos/facebookresearch/ParlAI","forks_url":"https://api.github.com/repos/facebookresearch/ParlAI/forks","keys_url":"https://api.github.com/repos/facebookresearch/ParlAI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebookresearch/ParlAI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebookresearch/ParlAI/teams","hooks_url":"https://api.github.com/repos/facebookresearch/ParlAI/hooks","issue_events_url":"https://api.github.com/repos/facebookresearch/ParlAI/issues/events{/number}","events_url":"https://api.github.com/repos/facebookresearch/ParlAI/events","assignees_url":"https://api.github.com/repos/facebookresearch/ParlAI/assignees{/user}","branches_url":"https://api.github.com/repos/facebookresearch/ParlAI/branches{/branch}","tags_url":"https://api.github.com/repos/facebookresearch/ParlAI/tags","blobs_url":"https://api.github.com/repos/facebookresearch/ParlAI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebookresearch/ParlAI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebookresearch/ParlAI/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebookresearch/ParlAI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebookresearch/ParlAI/statuses/{sha}","languages_url":"https://api.github.com/repos/facebookresearch/ParlAI/languages","stargazers_url":"https://api.github.com/repos/facebookresearch/ParlAI/stargazers","contributors_url":"https://api.github.com/repos/facebookresearch/ParlAI/contributors","subscribers_url":"https://api.github.com/repos/facebookresearch/ParlAI/subscribers","subscription_url":"https://api.github.com/repos/facebookresearch/ParlAI/subscription","commits_url":"https://api.github.com/repos/facebookresearch/ParlAI/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebookresearch/ParlAI/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebookresearch/ParlAI/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebookresearch/ParlAI/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebookresearch/ParlAI/contents/{+path}","compare_url":"https://api.github.com/repos/facebookresearch/ParlAI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebookresearch/ParlAI/merges","archive_url":"https://api.github.com/repos/facebookresearch/ParlAI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebookresearch/ParlAI/downloads","issues_url":"https://api.github.com/repos/facebookresearch/ParlAI/issues{/number}","pulls_url":"https://api.github.com/repos/facebookresearch/ParlAI/pulls{/number}","milestones_url":"https://api.github.com/repos/facebookresearch/ParlAI/milestones{/number}","notifications_url":"https://api.github.com/repos/facebookresearch/ParlAI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebookresearch/ParlAI/labels{/name}","releases_url":"https://api.github.com/repos/facebookresearch/ParlAI/releases{/id}","deployments_url":"https://api.github.com/repos/facebookresearch/ParlAI/deployments","created_at":"2017-04-24T17:10:44Z","updated_at":"2018-08-02T17:49:30Z","pushed_at":"2018-08-02T17:49:28Z","git_url":"git://github.com/facebookresearch/ParlAI.git","ssh_url":"git@github.com:facebookresearch/ParlAI.git","clone_url":"https://github.com/facebookresearch/ParlAI.git","svn_url":"https://github.com/facebookresearch/ParlAI","homepage":"parl.ai","size":11766,"stargazers_count":3514,"watchers_count":3514,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":620,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":620,"open_issues":21,"watchers":3514,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebookresearch/ParlAI/pulls/966"},"html":{"href":"https://github.com/facebookresearch/ParlAI/pull/966"},"issue":{"href":"https://api.github.com/repos/facebookresearch/ParlAI/issues/966"},"comments":{"href":"https://api.github.com/repos/facebookresearch/ParlAI/issues/966/comments"},"review_comments":{"href":"https://api.github.com/repos/facebookresearch/ParlAI/pulls/966/comments"},"review_comment":{"href":"https://api.github.com/repos/facebookresearch/ParlAI/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebookresearch/ParlAI/pulls/966/commits"},"statuses":{"href":"https://api.github.com/repos/facebookresearch/ParlAI/statuses/bf1515684d1dbb5014083c179248880b9aa71a20"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alexholdenmiller"}}