{"action":"created","comment":{"url":"https://api.github.com/repos/xapian/xapian/pulls/comments/135575315","pull_request_review_id":59001386,"id":135575315,"diff_hunk":"@@ -65,22 +65,41 @@ class XAPIAN_VISIBILITY_DEFAULT NDCGScore: public Scorer {\n     ~NDCGScore();\n \n     double score(const std::vector<FeatureVector> & fvv) const;\n+\n };\n \n-/** ERRScore class\n- *  ERR Score is adapted from the paper: goo.gl/Cs3ydQ\n+/** Expected Reciprocal Rank(ERR) Scorer.\n+ *  ERR Scorer is adapted from the paper:\n+ *  http://olivier.chapelle.cc/pub/err.pdf\n  *  Chapelle, Metzler, Zhang, Grinspan (2009)\n  *  Expected Reciprocal Rank for Graded Relevance\n  */\n-class XAPIAN_VISIBILITY_DEFAULT ERRScore: public Scorer {\n+class XAPIAN_VISIBILITY_DEFAULT ERRScore : public Scorer {\n+    /* max_grade is the maximum grade that a label can be mapped to.\n+     * The relevance label that user sets for the documents can be arbitary\n+     * and huge. Computing the probability of relevance for the documents,\n+     * which involves computing pow(2, label), can be time consuming.\n+     * To reduce the time complexity the labels are mapped to a smaller space\n+     * i.e. {0, 1, 2,...., max_grade}.\n+     * By default max_grade is 4.\n+     */\n+    int max_grade = 4;\n+\n   public:\n     /// Default constructor\n     ERRScore();\n \n+    /// Function to set max_grade\n+    void set_max_grade(int max_grade_);","path":"xapian-letor/include/xapian-letor/scorer.h","position":null,"original_position":32,"commit_id":"68cdb9953e19973582281dfdbec267d84283f007","original_commit_id":"68cdb9953e19973582281dfdbec267d84283f007","user":{"login":"jaylett","id":80187,"avatar_url":"https://avatars3.githubusercontent.com/u/80187?v=4","gravatar_id":"","url":"https://api.github.com/users/jaylett","html_url":"https://github.com/jaylett","followers_url":"https://api.github.com/users/jaylett/followers","following_url":"https://api.github.com/users/jaylett/following{/other_user}","gists_url":"https://api.github.com/users/jaylett/gists{/gist_id}","starred_url":"https://api.github.com/users/jaylett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaylett/subscriptions","organizations_url":"https://api.github.com/users/jaylett/orgs","repos_url":"https://api.github.com/users/jaylett/repos","events_url":"https://api.github.com/users/jaylett/events{/privacy}","received_events_url":"https://api.github.com/users/jaylett/received_events","type":"User","site_admin":false},"body":"Why? It's a lightweight class, in almost all cases it'd be clearer just to make a new one.","created_at":"2017-08-28T16:58:13Z","updated_at":"2017-08-28T16:58:13Z","html_url":"https://github.com/xapian/xapian/pull/179#discussion_r135575315","pull_request_url":"https://api.github.com/repos/xapian/xapian/pulls/179","_links":{"self":{"href":"https://api.github.com/repos/xapian/xapian/pulls/comments/135575315"},"html":{"href":"https://github.com/xapian/xapian/pull/179#discussion_r135575315"},"pull_request":{"href":"https://api.github.com/repos/xapian/xapian/pulls/179"}},"in_reply_to_id":135562651},"pull_request":{"url":"https://api.github.com/repos/xapian/xapian/pulls/179","id":137650908,"html_url":"https://github.com/xapian/xapian/pull/179","diff_url":"https://github.com/xapian/xapian/pull/179.diff","patch_url":"https://github.com/xapian/xapian/pull/179.patch","issue_url":"https://api.github.com/repos/xapian/xapian/issues/179","number":179,"state":"open","locked":false,"title":"Add ERR Scorer to xapian-letor","user":{"login":"AyushP123","id":9451641,"avatar_url":"https://avatars1.githubusercontent.com/u/9451641?v=4","gravatar_id":"","url":"https://api.github.com/users/AyushP123","html_url":"https://github.com/AyushP123","followers_url":"https://api.github.com/users/AyushP123/followers","following_url":"https://api.github.com/users/AyushP123/following{/other_user}","gists_url":"https://api.github.com/users/AyushP123/gists{/gist_id}","starred_url":"https://api.github.com/users/AyushP123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AyushP123/subscriptions","organizations_url":"https://api.github.com/users/AyushP123/orgs","repos_url":"https://api.github.com/users/AyushP123/repos","events_url":"https://api.github.com/users/AyushP123/events{/privacy}","received_events_url":"https://api.github.com/users/AyushP123/received_events","type":"User","site_admin":false},"body":"Have integrated the ERR Scorer from [vhasu's 2014 repository](https://github.com/v-hasu/xapian/tree/gsoc2014/xapian-letor). It meets\r\nxapian coding standards. The changes made to xapian-letor have been\r\naccomodated while integrating this scorer. Tests have also been added\r\nfor the scorer.","created_at":"2017-08-25T11:10:48Z","updated_at":"2017-08-28T16:58:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a66d1e23b2d6cef5ae2d0700c80b899c545590ac","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/xapian/xapian/pulls/179/commits","review_comments_url":"https://api.github.com/repos/xapian/xapian/pulls/179/comments","review_comment_url":"https://api.github.com/repos/xapian/xapian/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xapian/xapian/issues/179/comments","statuses_url":"https://api.github.com/repos/xapian/xapian/statuses/68cdb9953e19973582281dfdbec267d84283f007","head":{"label":"AyushP123:err_scorer","ref":"err_scorer","sha":"68cdb9953e19973582281dfdbec267d84283f007","user":{"login":"AyushP123","id":9451641,"avatar_url":"https://avatars1.githubusercontent.com/u/9451641?v=4","gravatar_id":"","url":"https://api.github.com/users/AyushP123","html_url":"https://github.com/AyushP123","followers_url":"https://api.github.com/users/AyushP123/followers","following_url":"https://api.github.com/users/AyushP123/following{/other_user}","gists_url":"https://api.github.com/users/AyushP123/gists{/gist_id}","starred_url":"https://api.github.com/users/AyushP123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AyushP123/subscriptions","organizations_url":"https://api.github.com/users/AyushP123/orgs","repos_url":"https://api.github.com/users/AyushP123/repos","events_url":"https://api.github.com/users/AyushP123/events{/privacy}","received_events_url":"https://api.github.com/users/AyushP123/received_events","type":"User","site_admin":false},"repo":{"id":79650721,"name":"xapian","full_name":"AyushP123/xapian","owner":{"login":"AyushP123","id":9451641,"avatar_url":"https://avatars1.githubusercontent.com/u/9451641?v=4","gravatar_id":"","url":"https://api.github.com/users/AyushP123","html_url":"https://github.com/AyushP123","followers_url":"https://api.github.com/users/AyushP123/followers","following_url":"https://api.github.com/users/AyushP123/following{/other_user}","gists_url":"https://api.github.com/users/AyushP123/gists{/gist_id}","starred_url":"https://api.github.com/users/AyushP123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AyushP123/subscriptions","organizations_url":"https://api.github.com/users/AyushP123/orgs","repos_url":"https://api.github.com/users/AyushP123/repos","events_url":"https://api.github.com/users/AyushP123/events{/privacy}","received_events_url":"https://api.github.com/users/AyushP123/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AyushP123/xapian","description":"Mirror of the Xapian repository.  You're welcome to open pull requests on github (they'll just get merged indirectly).","fork":true,"url":"https://api.github.com/repos/AyushP123/xapian","forks_url":"https://api.github.com/repos/AyushP123/xapian/forks","keys_url":"https://api.github.com/repos/AyushP123/xapian/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AyushP123/xapian/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AyushP123/xapian/teams","hooks_url":"https://api.github.com/repos/AyushP123/xapian/hooks","issue_events_url":"https://api.github.com/repos/AyushP123/xapian/issues/events{/number}","events_url":"https://api.github.com/repos/AyushP123/xapian/events","assignees_url":"https://api.github.com/repos/AyushP123/xapian/assignees{/user}","branches_url":"https://api.github.com/repos/AyushP123/xapian/branches{/branch}","tags_url":"https://api.github.com/repos/AyushP123/xapian/tags","blobs_url":"https://api.github.com/repos/AyushP123/xapian/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AyushP123/xapian/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AyushP123/xapian/git/refs{/sha}","trees_url":"https://api.github.com/repos/AyushP123/xapian/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AyushP123/xapian/statuses/{sha}","languages_url":"https://api.github.com/repos/AyushP123/xapian/languages","stargazers_url":"https://api.github.com/repos/AyushP123/xapian/stargazers","contributors_url":"https://api.github.com/repos/AyushP123/xapian/contributors","subscribers_url":"https://api.github.com/repos/AyushP123/xapian/subscribers","subscription_url":"https://api.github.com/repos/AyushP123/xapian/subscription","commits_url":"https://api.github.com/repos/AyushP123/xapian/commits{/sha}","git_commits_url":"https://api.github.com/repos/AyushP123/xapian/git/commits{/sha}","comments_url":"https://api.github.com/repos/AyushP123/xapian/comments{/number}","issue_comment_url":"https://api.github.com/repos/AyushP123/xapian/issues/comments{/number}","contents_url":"https://api.github.com/repos/AyushP123/xapian/contents/{+path}","compare_url":"https://api.github.com/repos/AyushP123/xapian/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AyushP123/xapian/merges","archive_url":"https://api.github.com/repos/AyushP123/xapian/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AyushP123/xapian/downloads","issues_url":"https://api.github.com/repos/AyushP123/xapian/issues{/number}","pulls_url":"https://api.github.com/repos/AyushP123/xapian/pulls{/number}","milestones_url":"https://api.github.com/repos/AyushP123/xapian/milestones{/number}","notifications_url":"https://api.github.com/repos/AyushP123/xapian/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AyushP123/xapian/labels{/name}","releases_url":"https://api.github.com/repos/AyushP123/xapian/releases{/id}","deployments_url":"https://api.github.com/repos/AyushP123/xapian/deployments","created_at":"2017-01-21T14:31:07Z","updated_at":"2017-01-21T14:31:16Z","pushed_at":"2017-08-28T15:53:32Z","git_url":"git://github.com/AyushP123/xapian.git","ssh_url":"git@github.com:AyushP123/xapian.git","clone_url":"https://github.com/AyushP123/xapian.git","svn_url":"https://github.com/AyushP123/xapian","homepage":"https://xapian.org/","size":77375,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xapian:master","ref":"master","sha":"6b298ed1202b7346e40f6d2a3e3baa4512869af3","user":{"login":"xapian","id":312861,"avatar_url":"https://avatars0.githubusercontent.com/u/312861?v=4","gravatar_id":"","url":"https://api.github.com/users/xapian","html_url":"https://github.com/xapian","followers_url":"https://api.github.com/users/xapian/followers","following_url":"https://api.github.com/users/xapian/following{/other_user}","gists_url":"https://api.github.com/users/xapian/gists{/gist_id}","starred_url":"https://api.github.com/users/xapian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xapian/subscriptions","organizations_url":"https://api.github.com/users/xapian/orgs","repos_url":"https://api.github.com/users/xapian/repos","events_url":"https://api.github.com/users/xapian/events{/privacy}","received_events_url":"https://api.github.com/users/xapian/received_events","type":"Organization","site_admin":false},"repo":{"id":735981,"name":"xapian","full_name":"xapian/xapian","owner":{"login":"xapian","id":312861,"avatar_url":"https://avatars0.githubusercontent.com/u/312861?v=4","gravatar_id":"","url":"https://api.github.com/users/xapian","html_url":"https://github.com/xapian","followers_url":"https://api.github.com/users/xapian/followers","following_url":"https://api.github.com/users/xapian/following{/other_user}","gists_url":"https://api.github.com/users/xapian/gists{/gist_id}","starred_url":"https://api.github.com/users/xapian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xapian/subscriptions","organizations_url":"https://api.github.com/users/xapian/orgs","repos_url":"https://api.github.com/users/xapian/repos","events_url":"https://api.github.com/users/xapian/events{/privacy}","received_events_url":"https://api.github.com/users/xapian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xapian/xapian","description":"Mirror of the Xapian repository.  You're welcome to open pull requests on github (they'll just get merged indirectly).","fork":false,"url":"https://api.github.com/repos/xapian/xapian","forks_url":"https://api.github.com/repos/xapian/xapian/forks","keys_url":"https://api.github.com/repos/xapian/xapian/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xapian/xapian/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xapian/xapian/teams","hooks_url":"https://api.github.com/repos/xapian/xapian/hooks","issue_events_url":"https://api.github.com/repos/xapian/xapian/issues/events{/number}","events_url":"https://api.github.com/repos/xapian/xapian/events","assignees_url":"https://api.github.com/repos/xapian/xapian/assignees{/user}","branches_url":"https://api.github.com/repos/xapian/xapian/branches{/branch}","tags_url":"https://api.github.com/repos/xapian/xapian/tags","blobs_url":"https://api.github.com/repos/xapian/xapian/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xapian/xapian/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xapian/xapian/git/refs{/sha}","trees_url":"https://api.github.com/repos/xapian/xapian/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xapian/xapian/statuses/{sha}","languages_url":"https://api.github.com/repos/xapian/xapian/languages","stargazers_url":"https://api.github.com/repos/xapian/xapian/stargazers","contributors_url":"https://api.github.com/repos/xapian/xapian/contributors","subscribers_url":"https://api.github.com/repos/xapian/xapian/subscribers","subscription_url":"https://api.github.com/repos/xapian/xapian/subscription","commits_url":"https://api.github.com/repos/xapian/xapian/commits{/sha}","git_commits_url":"https://api.github.com/repos/xapian/xapian/git/commits{/sha}","comments_url":"https://api.github.com/repos/xapian/xapian/comments{/number}","issue_comment_url":"https://api.github.com/repos/xapian/xapian/issues/comments{/number}","contents_url":"https://api.github.com/repos/xapian/xapian/contents/{+path}","compare_url":"https://api.github.com/repos/xapian/xapian/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xapian/xapian/merges","archive_url":"https://api.github.com/repos/xapian/xapian/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xapian/xapian/downloads","issues_url":"https://api.github.com/repos/xapian/xapian/issues{/number}","pulls_url":"https://api.github.com/repos/xapian/xapian/pulls{/number}","milestones_url":"https://api.github.com/repos/xapian/xapian/milestones{/number}","notifications_url":"https://api.github.com/repos/xapian/xapian/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xapian/xapian/labels{/name}","releases_url":"https://api.github.com/repos/xapian/xapian/releases{/id}","deployments_url":"https://api.github.com/repos/xapian/xapian/deployments","created_at":"2010-06-23T15:51:03Z","updated_at":"2017-08-22T12:01:38Z","pushed_at":"2017-08-28T15:53:34Z","git_url":"git://github.com/xapian/xapian.git","ssh_url":"git@github.com:xapian/xapian.git","clone_url":"https://github.com/xapian/xapian.git","svn_url":"https://github.com/xapian/xapian","homepage":"https://xapian.org/","size":77528,"stargazers_count":348,"watchers_count":348,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":177,"mirror_url":null,"open_issues_count":15,"forks":177,"open_issues":15,"watchers":348,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xapian/xapian/pulls/179"},"html":{"href":"https://github.com/xapian/xapian/pull/179"},"issue":{"href":"https://api.github.com/repos/xapian/xapian/issues/179"},"comments":{"href":"https://api.github.com/repos/xapian/xapian/issues/179/comments"},"review_comments":{"href":"https://api.github.com/repos/xapian/xapian/pulls/179/comments"},"review_comment":{"href":"https://api.github.com/repos/xapian/xapian/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xapian/xapian/pulls/179/commits"},"statuses":{"href":"https://api.github.com/repos/xapian/xapian/statuses/68cdb9953e19973582281dfdbec267d84283f007"}}}}
{"actor":{"display_login":"jaylett"}}