{"action":"created","comment":{"url":"https://api.github.com/repos/allenai/allennlp/pulls/comments/187150808","pull_request_review_id":118839208,"id":187150808,"diff_hunk":"@@ -322,3 +340,47 @@ def _should_split_cell(cls, cell_text: str) -> bool:\n         if ', ' in cell_text or '\\n' in cell_text or '/' in cell_text:\n             return True\n         return False\n+\n+    def get_linked_agenda_items(self) -> List[str]:\n+        \"\"\"\n+        Returns entities that can be linked to spans in the question, that should be in the agenda,\n+        for training a coverage based semantic parser. This method essentially does a heuristic\n+        entity linking, to provide weak supervision for a learning to search parser.\n+        \"\"\"\n+        agenda_items: List[str] = []\n+        for entity in self._get_longest_span_matching_entities():\n+            agenda_items.append(entity)\n+            # If the entity is a cell, we need to add the column to the agenda as well,\n+            # because the answer most likely involves getting the row witht he cell.\n+            if 'fb:cell' in entity:\n+                agenda_items.append(self.neighbors[entity][0])\n+        return agenda_items\n+\n+    def _get_longest_span_matching_entities(self):\n+        question = \" \".join([token.text for token in self.question_tokens])\n+        matches_starting_at: Dict[int, List[str]] = defaultdict(list)\n+        for index, token in enumerate(self.question_tokens):\n+            if token.text in self._entity_prefixes:\n+                for entity in self._entity_prefixes[token.text]:\n+                    if self.entity_text[entity].lower() in question:\n+                        matches_starting_at[index].append(entity)\n+        longest_matches: List[str] = []\n+        for index, matches in matches_starting_at.items():\n+            longest_matches.append(sorted(matches, key=len)[-1])\n+        return longest_matches\n+\n+    @overrides\n+    def __eq__(self, other):\n+        if isinstance(self, other.__class__):\n+            for key in self.__dict__:\n+                if key == \"question_tokens\":","path":"allennlp/semparse/contexts/table_question_knowledge_graph.py","position":89,"original_position":89,"commit_id":"89f704a630535bf47ec70d64a9742e95b3b3ff02","original_commit_id":"89f704a630535bf47ec70d64a9742e95b3b3ff02","user":{"login":"matt-gardner","id":3291951,"avatar_url":"https://avatars2.githubusercontent.com/u/3291951?v=4","gravatar_id":"","url":"https://api.github.com/users/matt-gardner","html_url":"https://github.com/matt-gardner","followers_url":"https://api.github.com/users/matt-gardner/followers","following_url":"https://api.github.com/users/matt-gardner/following{/other_user}","gists_url":"https://api.github.com/users/matt-gardner/gists{/gist_id}","starred_url":"https://api.github.com/users/matt-gardner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matt-gardner/subscriptions","organizations_url":"https://api.github.com/users/matt-gardner/orgs","repos_url":"https://api.github.com/users/matt-gardner/repos","events_url":"https://api.github.com/users/matt-gardner/events{/privacy}","received_events_url":"https://api.github.com/users/matt-gardner/received_events","type":"User","site_admin":false},"body":"Is this because spacy tokens don't behave nicely?  If so, it'd be nice to put a comment here for why you need this complex logic.","created_at":"2018-05-09T19:30:26Z","updated_at":"2018-05-09T19:40:58Z","html_url":"https://github.com/allenai/allennlp/pull/1181#discussion_r187150808","pull_request_url":"https://api.github.com/repos/allenai/allennlp/pulls/1181","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/allenai/allennlp/pulls/comments/187150808"},"html":{"href":"https://github.com/allenai/allennlp/pull/1181#discussion_r187150808"},"pull_request":{"href":"https://api.github.com/repos/allenai/allennlp/pulls/1181"}}},"pull_request":{"url":"https://api.github.com/repos/allenai/allennlp/pulls/1181","id":186459342,"html_url":"https://github.com/allenai/allennlp/pull/1181","diff_url":"https://github.com/allenai/allennlp/pull/1181.diff","patch_url":"https://github.com/allenai/allennlp/pull/1181.patch","issue_url":"https://api.github.com/repos/allenai/allennlp/issues/1181","number":1181,"state":"open","locked":false,"title":"Added coverage to WikiTables ERM parser","user":{"login":"pdasigi","id":3508113,"avatar_url":"https://avatars2.githubusercontent.com/u/3508113?v=4","gravatar_id":"","url":"https://api.github.com/users/pdasigi","html_url":"https://github.com/pdasigi","followers_url":"https://api.github.com/users/pdasigi/followers","following_url":"https://api.github.com/users/pdasigi/following{/other_user}","gists_url":"https://api.github.com/users/pdasigi/gists{/gist_id}","starred_url":"https://api.github.com/users/pdasigi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdasigi/subscriptions","organizations_url":"https://api.github.com/users/pdasigi/orgs","repos_url":"https://api.github.com/users/pdasigi/repos","events_url":"https://api.github.com/users/pdasigi/events{/privacy}","received_events_url":"https://api.github.com/users/pdasigi/received_events","type":"User","site_admin":false},"body":"Summary of changes:\r\n1) I defined some simple rules for agenda mapping in wikitables\r\n2) added checklists and agendas to the decoder state\r\n3) included checklist cost in cost computation in the learning to search model\r\n4) updated output action logits computation\r\n\r\nThe modification related to the output action logits turned out to be challenging. In nlvr, it was simply a matter of computing checklist balances and concatenating them to hidden states of the decoder and the attended encoder outputs before projecting them to a predicted output embedding space. However, in wikitables, since some of the actions are linked, I had to split the checklist balances into two, one for embedded action and the other for linked actions, and use the first for predicting output embedding and the second for modifying entity action logits.\r\nDepends on #1159 ","created_at":"2018-05-07T20:44:22Z","updated_at":"2018-05-09T19:40:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"019dbec92ac24cae7fa9643f3f4b4f917b7705c7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/allenai/allennlp/pulls/1181/commits","review_comments_url":"https://api.github.com/repos/allenai/allennlp/pulls/1181/comments","review_comment_url":"https://api.github.com/repos/allenai/allennlp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/allenai/allennlp/issues/1181/comments","statuses_url":"https://api.github.com/repos/allenai/allennlp/statuses/89f704a630535bf47ec70d64a9742e95b3b3ff02","head":{"label":"pdasigi:wikitables_agenda","ref":"wikitables_agenda","sha":"89f704a630535bf47ec70d64a9742e95b3b3ff02","user":{"login":"pdasigi","id":3508113,"avatar_url":"https://avatars2.githubusercontent.com/u/3508113?v=4","gravatar_id":"","url":"https://api.github.com/users/pdasigi","html_url":"https://github.com/pdasigi","followers_url":"https://api.github.com/users/pdasigi/followers","following_url":"https://api.github.com/users/pdasigi/following{/other_user}","gists_url":"https://api.github.com/users/pdasigi/gists{/gist_id}","starred_url":"https://api.github.com/users/pdasigi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdasigi/subscriptions","organizations_url":"https://api.github.com/users/pdasigi/orgs","repos_url":"https://api.github.com/users/pdasigi/repos","events_url":"https://api.github.com/users/pdasigi/events{/privacy}","received_events_url":"https://api.github.com/users/pdasigi/received_events","type":"User","site_admin":false},"repo":{"id":101232158,"name":"allennlp","full_name":"pdasigi/allennlp","owner":{"login":"pdasigi","id":3508113,"avatar_url":"https://avatars2.githubusercontent.com/u/3508113?v=4","gravatar_id":"","url":"https://api.github.com/users/pdasigi","html_url":"https://github.com/pdasigi","followers_url":"https://api.github.com/users/pdasigi/followers","following_url":"https://api.github.com/users/pdasigi/following{/other_user}","gists_url":"https://api.github.com/users/pdasigi/gists{/gist_id}","starred_url":"https://api.github.com/users/pdasigi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdasigi/subscriptions","organizations_url":"https://api.github.com/users/pdasigi/orgs","repos_url":"https://api.github.com/users/pdasigi/repos","events_url":"https://api.github.com/users/pdasigi/events{/privacy}","received_events_url":"https://api.github.com/users/pdasigi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pdasigi/allennlp","description":"An open-source NLP research library, built on PyTorch.","fork":true,"url":"https://api.github.com/repos/pdasigi/allennlp","forks_url":"https://api.github.com/repos/pdasigi/allennlp/forks","keys_url":"https://api.github.com/repos/pdasigi/allennlp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pdasigi/allennlp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pdasigi/allennlp/teams","hooks_url":"https://api.github.com/repos/pdasigi/allennlp/hooks","issue_events_url":"https://api.github.com/repos/pdasigi/allennlp/issues/events{/number}","events_url":"https://api.github.com/repos/pdasigi/allennlp/events","assignees_url":"https://api.github.com/repos/pdasigi/allennlp/assignees{/user}","branches_url":"https://api.github.com/repos/pdasigi/allennlp/branches{/branch}","tags_url":"https://api.github.com/repos/pdasigi/allennlp/tags","blobs_url":"https://api.github.com/repos/pdasigi/allennlp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pdasigi/allennlp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pdasigi/allennlp/git/refs{/sha}","trees_url":"https://api.github.com/repos/pdasigi/allennlp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pdasigi/allennlp/statuses/{sha}","languages_url":"https://api.github.com/repos/pdasigi/allennlp/languages","stargazers_url":"https://api.github.com/repos/pdasigi/allennlp/stargazers","contributors_url":"https://api.github.com/repos/pdasigi/allennlp/contributors","subscribers_url":"https://api.github.com/repos/pdasigi/allennlp/subscribers","subscription_url":"https://api.github.com/repos/pdasigi/allennlp/subscription","commits_url":"https://api.github.com/repos/pdasigi/allennlp/commits{/sha}","git_commits_url":"https://api.github.com/repos/pdasigi/allennlp/git/commits{/sha}","comments_url":"https://api.github.com/repos/pdasigi/allennlp/comments{/number}","issue_comment_url":"https://api.github.com/repos/pdasigi/allennlp/issues/comments{/number}","contents_url":"https://api.github.com/repos/pdasigi/allennlp/contents/{+path}","compare_url":"https://api.github.com/repos/pdasigi/allennlp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pdasigi/allennlp/merges","archive_url":"https://api.github.com/repos/pdasigi/allennlp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pdasigi/allennlp/downloads","issues_url":"https://api.github.com/repos/pdasigi/allennlp/issues{/number}","pulls_url":"https://api.github.com/repos/pdasigi/allennlp/pulls{/number}","milestones_url":"https://api.github.com/repos/pdasigi/allennlp/milestones{/number}","notifications_url":"https://api.github.com/repos/pdasigi/allennlp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pdasigi/allennlp/labels{/name}","releases_url":"https://api.github.com/repos/pdasigi/allennlp/releases{/id}","deployments_url":"https://api.github.com/repos/pdasigi/allennlp/deployments","created_at":"2017-08-23T23:05:48Z","updated_at":"2018-04-24T17:20:19Z","pushed_at":"2018-05-09T00:25:24Z","git_url":"git://github.com/pdasigi/allennlp.git","ssh_url":"git@github.com:pdasigi/allennlp.git","clone_url":"https://github.com/pdasigi/allennlp.git","svn_url":"https://github.com/pdasigi/allennlp","homepage":"http://www.allennlp.org/","size":13706,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"allenai:master","ref":"master","sha":"7142962d330ca5a95cade114c26a361c78f2042e","user":{"login":"allenai","id":5667695,"avatar_url":"https://avatars3.githubusercontent.com/u/5667695?v=4","gravatar_id":"","url":"https://api.github.com/users/allenai","html_url":"https://github.com/allenai","followers_url":"https://api.github.com/users/allenai/followers","following_url":"https://api.github.com/users/allenai/following{/other_user}","gists_url":"https://api.github.com/users/allenai/gists{/gist_id}","starred_url":"https://api.github.com/users/allenai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenai/subscriptions","organizations_url":"https://api.github.com/users/allenai/orgs","repos_url":"https://api.github.com/users/allenai/repos","events_url":"https://api.github.com/users/allenai/events{/privacy}","received_events_url":"https://api.github.com/users/allenai/received_events","type":"Organization","site_admin":false},"repo":{"id":91356408,"name":"allennlp","full_name":"allenai/allennlp","owner":{"login":"allenai","id":5667695,"avatar_url":"https://avatars3.githubusercontent.com/u/5667695?v=4","gravatar_id":"","url":"https://api.github.com/users/allenai","html_url":"https://github.com/allenai","followers_url":"https://api.github.com/users/allenai/followers","following_url":"https://api.github.com/users/allenai/following{/other_user}","gists_url":"https://api.github.com/users/allenai/gists{/gist_id}","starred_url":"https://api.github.com/users/allenai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenai/subscriptions","organizations_url":"https://api.github.com/users/allenai/orgs","repos_url":"https://api.github.com/users/allenai/repos","events_url":"https://api.github.com/users/allenai/events{/privacy}","received_events_url":"https://api.github.com/users/allenai/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/allenai/allennlp","description":"An open-source NLP research library, built on PyTorch.","fork":false,"url":"https://api.github.com/repos/allenai/allennlp","forks_url":"https://api.github.com/repos/allenai/allennlp/forks","keys_url":"https://api.github.com/repos/allenai/allennlp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allenai/allennlp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allenai/allennlp/teams","hooks_url":"https://api.github.com/repos/allenai/allennlp/hooks","issue_events_url":"https://api.github.com/repos/allenai/allennlp/issues/events{/number}","events_url":"https://api.github.com/repos/allenai/allennlp/events","assignees_url":"https://api.github.com/repos/allenai/allennlp/assignees{/user}","branches_url":"https://api.github.com/repos/allenai/allennlp/branches{/branch}","tags_url":"https://api.github.com/repos/allenai/allennlp/tags","blobs_url":"https://api.github.com/repos/allenai/allennlp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allenai/allennlp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allenai/allennlp/git/refs{/sha}","trees_url":"https://api.github.com/repos/allenai/allennlp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allenai/allennlp/statuses/{sha}","languages_url":"https://api.github.com/repos/allenai/allennlp/languages","stargazers_url":"https://api.github.com/repos/allenai/allennlp/stargazers","contributors_url":"https://api.github.com/repos/allenai/allennlp/contributors","subscribers_url":"https://api.github.com/repos/allenai/allennlp/subscribers","subscription_url":"https://api.github.com/repos/allenai/allennlp/subscription","commits_url":"https://api.github.com/repos/allenai/allennlp/commits{/sha}","git_commits_url":"https://api.github.com/repos/allenai/allennlp/git/commits{/sha}","comments_url":"https://api.github.com/repos/allenai/allennlp/comments{/number}","issue_comment_url":"https://api.github.com/repos/allenai/allennlp/issues/comments{/number}","contents_url":"https://api.github.com/repos/allenai/allennlp/contents/{+path}","compare_url":"https://api.github.com/repos/allenai/allennlp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allenai/allennlp/merges","archive_url":"https://api.github.com/repos/allenai/allennlp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allenai/allennlp/downloads","issues_url":"https://api.github.com/repos/allenai/allennlp/issues{/number}","pulls_url":"https://api.github.com/repos/allenai/allennlp/pulls{/number}","milestones_url":"https://api.github.com/repos/allenai/allennlp/milestones{/number}","notifications_url":"https://api.github.com/repos/allenai/allennlp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allenai/allennlp/labels{/name}","releases_url":"https://api.github.com/repos/allenai/allennlp/releases{/id}","deployments_url":"https://api.github.com/repos/allenai/allennlp/deployments","created_at":"2017-05-15T15:52:41Z","updated_at":"2018-05-09T15:23:00Z","pushed_at":"2018-05-09T04:58:15Z","git_url":"git://github.com/allenai/allennlp.git","ssh_url":"git@github.com:allenai/allennlp.git","clone_url":"https://github.com/allenai/allennlp.git","svn_url":"https://github.com/allenai/allennlp","homepage":"http://www.allennlp.org/","size":10856,"stargazers_count":2032,"watchers_count":2032,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":298,"mirror_url":null,"archived":false,"open_issues_count":72,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":298,"open_issues":72,"watchers":2032,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/allenai/allennlp/pulls/1181"},"html":{"href":"https://github.com/allenai/allennlp/pull/1181"},"issue":{"href":"https://api.github.com/repos/allenai/allennlp/issues/1181"},"comments":{"href":"https://api.github.com/repos/allenai/allennlp/issues/1181/comments"},"review_comments":{"href":"https://api.github.com/repos/allenai/allennlp/pulls/1181/comments"},"review_comment":{"href":"https://api.github.com/repos/allenai/allennlp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/allenai/allennlp/pulls/1181/commits"},"statuses":{"href":"https://api.github.com/repos/allenai/allennlp/statuses/89f704a630535bf47ec70d64a9742e95b3b3ff02"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"matt-gardner"}}