{"action":"created","comment":{"url":"https://api.github.com/repos/dlwh/epic/pulls/comments/33746957","id":33746957,"diff_hunk":"@@ -0,0 +1,357 @@\n+package epic.parser\n+package models\n+\n+import java.io.File\n+import breeze.config.Help\n+import breeze.features.FeatureVector\n+import breeze.linalg._\n+import breeze.util.Index\n+import epic.constraints.ChartConstraints\n+import epic.dense.{IdentityTransform, AffineTransform, Transform}\n+import epic.features.SurfaceFeaturizer.SingleWordSpanFeaturizer\n+import epic.features._\n+import epic.framework.Feature\n+import epic.lexicon.Lexicon\n+import epic.parser.projections.GrammarRefinements\n+import epic.trees._\n+import epic.trees.annotations.TreeAnnotator\n+import epic.util.{LRUCache, Optional}\n+import epic.dense.Transform\n+import epic.dense.TanhTransform\n+import epic.dense.OutputTransform\n+import epic.dense.AffineOutputTransform\n+import epic.dense.OutputEmbeddingTransform\n+import epic.dense.Word2Vec\n+import scala.collection.mutable.HashMap\n+import epic.dense.Word2VecSurfaceFeaturizerIndexed\n+import epic.dense.Word2VecDepFeaturizerIndexed\n+import epic.dense.Word2VecIndexed\n+import epic.dense.FrequencyTagger\n+import epic.dense.CachingLookupTransform\n+import epic.dense.CachingLookupAndAffineTransformDense\n+import epic.dense.EmbeddingsTransform\n+import epic.dense.NonlinearTransform\n+import scala.io.Source\n+import scala.collection.mutable.HashSet\n+import epic.dense.BatchNormalizationTransform\n+\n+/**\n+ * Entry point for instantiating a neural CRF parser. Parameters specify neural\n+ * net parameters, word vectors, and sparse features to use.\n+ *\n+ * @author gdurrett\n+ **/\n+\n+\n+/**\n+ * Less-used parameters\n+ */\n+case class ExtraPNMParams(@Help(text=\"Used for ablations with random word embeddings; don't change this. Options: normal, random, trivial, normalpos\")\n+                          embeddingType: String = \"normal\",\n+                          @Help(text=\"Use longest frequent suffix (standard representation) for sparse feats\")\n+                          useSparseLfsuf: Boolean = true,\n+                          @Help(text=\"Use sparse Brown cluster features\")\n+                          useSparseBrown: Boolean = false,\n+                          @Help(text=\"Use expanded set of sparse surface features (doesn't help)\")\n+                          useMostSparseIndicators: Boolean = false,\n+                          @Help(text=\"Scaling factor for all input vectors\")\n+                          vectorRescaling: Double = 1.0,\n+                          @Help(text=\"Use the output embedding model (Figure 4b in the neural CRF paper)\")\n+                          outputEmbedding: Boolean = false,\n+                          @Help(text=\"Dimension of the output embedding model\")\n+                          outputEmbeddingDim: Int = 20,\n+                          @Help(text=\"When initializing the output embedding model, initialize based on root symbols\")\n+                          coarsenByRoot: Boolean = false,\n+                          @Help(text=\"Use separate neural net parameters for span/unary/binary settings. Doesn't help.\")\n+                          decoupleTransforms: Boolean = false,\n+                          @Help(text=\"Extract additional output features based on root label.\")\n+                          useRootLabel: Boolean = false,\n+                          @Help(text=\"Set unknown word vectors to be random rather than 0\")","path":"src/main/scala/epic/parser/models/PositionalNeuralModelFactory.scala","position":69,"original_position":69,"commit_id":"e264cddef4bf4bd9310207b4f4e178fddf9209ac","original_commit_id":"e264cddef4bf4bd9310207b4f4e178fddf9209ac","user":{"login":"dlwh","id":9633,"avatar_url":"https://avatars.githubusercontent.com/u/9633?v=3","gravatar_id":"","url":"https://api.github.com/users/dlwh","html_url":"https://github.com/dlwh","followers_url":"https://api.github.com/users/dlwh/followers","following_url":"https://api.github.com/users/dlwh/following{/other_user}","gists_url":"https://api.github.com/users/dlwh/gists{/gist_id}","starred_url":"https://api.github.com/users/dlwh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlwh/subscriptions","organizations_url":"https://api.github.com/users/dlwh/orgs","repos_url":"https://api.github.com/users/dlwh/repos","events_url":"https://api.github.com/users/dlwh/events{/privacy}","received_events_url":"https://api.github.com/users/dlwh/received_events","type":"User","site_admin":false},"body":"why about setting them to a random word that is seen once in the treebank?","created_at":"2015-07-02T04:42:36Z","updated_at":"2015-07-02T04:42:36Z","html_url":"https://github.com/dlwh/epic/pull/33#discussion_r33746957","pull_request_url":"https://api.github.com/repos/dlwh/epic/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/dlwh/epic/pulls/comments/33746957"},"html":{"href":"https://github.com/dlwh/epic/pull/33#discussion_r33746957"},"pull_request":{"href":"https://api.github.com/repos/dlwh/epic/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/dlwh/epic/pulls/33","id":38374014,"html_url":"https://github.com/dlwh/epic/pull/33","diff_url":"https://github.com/dlwh/epic/pull/33.diff","patch_url":"https://github.com/dlwh/epic/pull/33.patch","issue_url":"https://api.github.com/repos/dlwh/epic/issues/33","number":33,"state":"open","locked":false,"title":"Neural epic","user":{"login":"gregdurrett","id":2175977,"avatar_url":"https://avatars.githubusercontent.com/u/2175977?v=3","gravatar_id":"","url":"https://api.github.com/users/gregdurrett","html_url":"https://github.com/gregdurrett","followers_url":"https://api.github.com/users/gregdurrett/followers","following_url":"https://api.github.com/users/gregdurrett/following{/other_user}","gists_url":"https://api.github.com/users/gregdurrett/gists{/gist_id}","starred_url":"https://api.github.com/users/gregdurrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregdurrett/subscriptions","organizations_url":"https://api.github.com/users/gregdurrett/orgs","repos_url":"https://api.github.com/users/gregdurrett/repos","events_url":"https://api.github.com/users/gregdurrett/events{/privacy}","received_events_url":"https://api.github.com/users/gregdurrett/received_events","type":"User","site_admin":false},"body":"Running one last experiment to build the pre-trained English model but this should basically be the pull request. Let me know if there's anything you want me to change.","created_at":"2015-06-23T19:33:14Z","updated_at":"2015-07-02T04:42:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9eb090302ab9f9b2332d08c3935c7ec9496f9661","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dlwh/epic/pulls/33/commits","review_comments_url":"https://api.github.com/repos/dlwh/epic/pulls/33/comments","review_comment_url":"https://api.github.com/repos/dlwh/epic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dlwh/epic/issues/33/comments","statuses_url":"https://api.github.com/repos/dlwh/epic/statuses/e264cddef4bf4bd9310207b4f4e178fddf9209ac","head":{"label":"dlwh:neural_epic","ref":"neural_epic","sha":"e264cddef4bf4bd9310207b4f4e178fddf9209ac","user":{"login":"dlwh","id":9633,"avatar_url":"https://avatars.githubusercontent.com/u/9633?v=3","gravatar_id":"","url":"https://api.github.com/users/dlwh","html_url":"https://github.com/dlwh","followers_url":"https://api.github.com/users/dlwh/followers","following_url":"https://api.github.com/users/dlwh/following{/other_user}","gists_url":"https://api.github.com/users/dlwh/gists{/gist_id}","starred_url":"https://api.github.com/users/dlwh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlwh/subscriptions","organizations_url":"https://api.github.com/users/dlwh/orgs","repos_url":"https://api.github.com/users/dlwh/repos","events_url":"https://api.github.com/users/dlwh/events{/privacy}","received_events_url":"https://api.github.com/users/dlwh/received_events","type":"User","site_admin":false},"repo":{"id":1639100,"name":"epic","full_name":"dlwh/epic","owner":{"login":"dlwh","id":9633,"avatar_url":"https://avatars.githubusercontent.com/u/9633?v=3","gravatar_id":"","url":"https://api.github.com/users/dlwh","html_url":"https://github.com/dlwh","followers_url":"https://api.github.com/users/dlwh/followers","following_url":"https://api.github.com/users/dlwh/following{/other_user}","gists_url":"https://api.github.com/users/dlwh/gists{/gist_id}","starred_url":"https://api.github.com/users/dlwh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlwh/subscriptions","organizations_url":"https://api.github.com/users/dlwh/orgs","repos_url":"https://api.github.com/users/dlwh/repos","events_url":"https://api.github.com/users/dlwh/events{/privacy}","received_events_url":"https://api.github.com/users/dlwh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dlwh/epic","description":"Epic is a high performance statistical parser written in Scala, along with a framework for building complex structured prediction models.","fork":false,"url":"https://api.github.com/repos/dlwh/epic","forks_url":"https://api.github.com/repos/dlwh/epic/forks","keys_url":"https://api.github.com/repos/dlwh/epic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dlwh/epic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dlwh/epic/teams","hooks_url":"https://api.github.com/repos/dlwh/epic/hooks","issue_events_url":"https://api.github.com/repos/dlwh/epic/issues/events{/number}","events_url":"https://api.github.com/repos/dlwh/epic/events","assignees_url":"https://api.github.com/repos/dlwh/epic/assignees{/user}","branches_url":"https://api.github.com/repos/dlwh/epic/branches{/branch}","tags_url":"https://api.github.com/repos/dlwh/epic/tags","blobs_url":"https://api.github.com/repos/dlwh/epic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dlwh/epic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dlwh/epic/git/refs{/sha}","trees_url":"https://api.github.com/repos/dlwh/epic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dlwh/epic/statuses/{sha}","languages_url":"https://api.github.com/repos/dlwh/epic/languages","stargazers_url":"https://api.github.com/repos/dlwh/epic/stargazers","contributors_url":"https://api.github.com/repos/dlwh/epic/contributors","subscribers_url":"https://api.github.com/repos/dlwh/epic/subscribers","subscription_url":"https://api.github.com/repos/dlwh/epic/subscription","commits_url":"https://api.github.com/repos/dlwh/epic/commits{/sha}","git_commits_url":"https://api.github.com/repos/dlwh/epic/git/commits{/sha}","comments_url":"https://api.github.com/repos/dlwh/epic/comments{/number}","issue_comment_url":"https://api.github.com/repos/dlwh/epic/issues/comments{/number}","contents_url":"https://api.github.com/repos/dlwh/epic/contents/{+path}","compare_url":"https://api.github.com/repos/dlwh/epic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dlwh/epic/merges","archive_url":"https://api.github.com/repos/dlwh/epic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dlwh/epic/downloads","issues_url":"https://api.github.com/repos/dlwh/epic/issues{/number}","pulls_url":"https://api.github.com/repos/dlwh/epic/pulls{/number}","milestones_url":"https://api.github.com/repos/dlwh/epic/milestones{/number}","notifications_url":"https://api.github.com/repos/dlwh/epic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dlwh/epic/labels{/name}","releases_url":"https://api.github.com/repos/dlwh/epic/releases{/id}","created_at":"2011-04-20T06:00:04Z","updated_at":"2015-06-29T12:40:50Z","pushed_at":"2015-06-26T01:02:22Z","git_url":"git://github.com/dlwh/epic.git","ssh_url":"git@github.com:dlwh/epic.git","clone_url":"https://github.com/dlwh/epic.git","svn_url":"https://github.com/dlwh/epic","homepage":"http://scalanlp.org/","size":22354,"stargazers_count":193,"watchers_count":193,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":10,"forks":40,"open_issues":10,"watchers":193,"default_branch":"master"}},"base":{"label":"dlwh:master","ref":"master","sha":"d623f95853c1bac67ac4fc8c916815b11b085b23","user":{"login":"dlwh","id":9633,"avatar_url":"https://avatars.githubusercontent.com/u/9633?v=3","gravatar_id":"","url":"https://api.github.com/users/dlwh","html_url":"https://github.com/dlwh","followers_url":"https://api.github.com/users/dlwh/followers","following_url":"https://api.github.com/users/dlwh/following{/other_user}","gists_url":"https://api.github.com/users/dlwh/gists{/gist_id}","starred_url":"https://api.github.com/users/dlwh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlwh/subscriptions","organizations_url":"https://api.github.com/users/dlwh/orgs","repos_url":"https://api.github.com/users/dlwh/repos","events_url":"https://api.github.com/users/dlwh/events{/privacy}","received_events_url":"https://api.github.com/users/dlwh/received_events","type":"User","site_admin":false},"repo":{"id":1639100,"name":"epic","full_name":"dlwh/epic","owner":{"login":"dlwh","id":9633,"avatar_url":"https://avatars.githubusercontent.com/u/9633?v=3","gravatar_id":"","url":"https://api.github.com/users/dlwh","html_url":"https://github.com/dlwh","followers_url":"https://api.github.com/users/dlwh/followers","following_url":"https://api.github.com/users/dlwh/following{/other_user}","gists_url":"https://api.github.com/users/dlwh/gists{/gist_id}","starred_url":"https://api.github.com/users/dlwh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlwh/subscriptions","organizations_url":"https://api.github.com/users/dlwh/orgs","repos_url":"https://api.github.com/users/dlwh/repos","events_url":"https://api.github.com/users/dlwh/events{/privacy}","received_events_url":"https://api.github.com/users/dlwh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dlwh/epic","description":"Epic is a high performance statistical parser written in Scala, along with a framework for building complex structured prediction models.","fork":false,"url":"https://api.github.com/repos/dlwh/epic","forks_url":"https://api.github.com/repos/dlwh/epic/forks","keys_url":"https://api.github.com/repos/dlwh/epic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dlwh/epic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dlwh/epic/teams","hooks_url":"https://api.github.com/repos/dlwh/epic/hooks","issue_events_url":"https://api.github.com/repos/dlwh/epic/issues/events{/number}","events_url":"https://api.github.com/repos/dlwh/epic/events","assignees_url":"https://api.github.com/repos/dlwh/epic/assignees{/user}","branches_url":"https://api.github.com/repos/dlwh/epic/branches{/branch}","tags_url":"https://api.github.com/repos/dlwh/epic/tags","blobs_url":"https://api.github.com/repos/dlwh/epic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dlwh/epic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dlwh/epic/git/refs{/sha}","trees_url":"https://api.github.com/repos/dlwh/epic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dlwh/epic/statuses/{sha}","languages_url":"https://api.github.com/repos/dlwh/epic/languages","stargazers_url":"https://api.github.com/repos/dlwh/epic/stargazers","contributors_url":"https://api.github.com/repos/dlwh/epic/contributors","subscribers_url":"https://api.github.com/repos/dlwh/epic/subscribers","subscription_url":"https://api.github.com/repos/dlwh/epic/subscription","commits_url":"https://api.github.com/repos/dlwh/epic/commits{/sha}","git_commits_url":"https://api.github.com/repos/dlwh/epic/git/commits{/sha}","comments_url":"https://api.github.com/repos/dlwh/epic/comments{/number}","issue_comment_url":"https://api.github.com/repos/dlwh/epic/issues/comments{/number}","contents_url":"https://api.github.com/repos/dlwh/epic/contents/{+path}","compare_url":"https://api.github.com/repos/dlwh/epic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dlwh/epic/merges","archive_url":"https://api.github.com/repos/dlwh/epic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dlwh/epic/downloads","issues_url":"https://api.github.com/repos/dlwh/epic/issues{/number}","pulls_url":"https://api.github.com/repos/dlwh/epic/pulls{/number}","milestones_url":"https://api.github.com/repos/dlwh/epic/milestones{/number}","notifications_url":"https://api.github.com/repos/dlwh/epic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dlwh/epic/labels{/name}","releases_url":"https://api.github.com/repos/dlwh/epic/releases{/id}","created_at":"2011-04-20T06:00:04Z","updated_at":"2015-06-29T12:40:50Z","pushed_at":"2015-06-26T01:02:22Z","git_url":"git://github.com/dlwh/epic.git","ssh_url":"git@github.com:dlwh/epic.git","clone_url":"https://github.com/dlwh/epic.git","svn_url":"https://github.com/dlwh/epic","homepage":"http://scalanlp.org/","size":22354,"stargazers_count":193,"watchers_count":193,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":10,"forks":40,"open_issues":10,"watchers":193,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dlwh/epic/pulls/33"},"html":{"href":"https://github.com/dlwh/epic/pull/33"},"issue":{"href":"https://api.github.com/repos/dlwh/epic/issues/33"},"comments":{"href":"https://api.github.com/repos/dlwh/epic/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/dlwh/epic/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/dlwh/epic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dlwh/epic/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/dlwh/epic/statuses/e264cddef4bf4bd9310207b4f4e178fddf9209ac"}}}}