GitHub PullRequestReviewCommentEvent at 2014-10-28 05:22:28
Repository: spark
Actor: mengxr
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/19453782","id":19453782,"diff_hunk":"@@ -162,6 +162,38 @@ for((synonym, cosineSimilarity) <- synonyms) {\n }\n {% endhighlight %}\n </div>\n+<div data-lang=\"python\">\n+{% highlight python %}\n+# This example uses text8 file from http://mattmahoney.net/dc/text8.zip\n+# The file was unziped and split into multiple lines using\n+# grep -o -E '\\w+(\\W+\\w+){0,15}' text8 > text8_lines\n+# This was done so that the example can be run in local mode\n+\n+from pyspark import SparkContext\n+from pyspark.mllib.feature import Word2Vec\n+\n+USAGE = (\"bin/spark-submit --driver-memory 4g \"\n+         \"examples/src/main/python/mllib/word2vec.py text8_lines\")\n+\n+\n+if __name__ == \"__main__\":\n+    if len(sys.argv) < 2:\n+        print USAGE\n+        return\n+    file_path = sys.argv[1]\n+    sc = SparkContext(appName='Word2Vec')\n+    inp = sc.textFile(\"text8_lines\").map(lambda row: [row])","path":"docs/mllib-feature-extraction.md","position":24,"original_position":24,"commit_id":"ee4f5f60725ac0e94ab6cc4969fa31b8bcf6d4f2","original_commit_id":"ee4f5f60725ac0e94ab6cc4969fa31b8bcf6d4f2","user":{"login":"mengxr","id":829644,"avatar_url":"https://avatars.githubusercontent.com/u/829644?v=2","gravatar_id":"","url":"https://api.github.com/users/mengxr","html_url":"https://github.com/mengxr","followers_url":"https://api.github.com/users/mengxr/followers","following_url":"https://api.github.com/users/mengxr/following{/other_user}","gists_url":"https://api.github.com/users/mengxr/gists{/gist_id}","starred_url":"https://api.github.com/users/mengxr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mengxr/subscriptions","organizations_url":"https://api.github.com/users/mengxr/orgs","repos_url":"https://api.github.com/users/mengxr/repos","events_url":"https://api.github.com/users/mengxr/events{/privacy}","received_events_url":"https://api.github.com/users/mengxr/received_events","type":"User","site_admin":false},"body":"`inp` -> `sentences`, `[row]` -> `row.split(' ')`","created_at":"2014-10-28T05:22:28Z","updated_at":"2014-10-28T05:22:28Z","html_url":"https://github.com/apache/spark/pull/2952#discussion_r19453782","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/2952","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/19453782"},"html":{"href":"https://github.com/apache/spark/pull/2952#discussion_r19453782"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/2952"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/2952","id":23359937,"html_url":"https://github.com/apache/spark/pull/2952","diff_url":"https://github.com/apache/spark/pull/2952.diff","patch_url":"https://github.com/apache/spark/pull/2952.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/2952","number":2952,"state":"open","locked":false,"title":"[SPARK-3838][examples][mllib][python] Word2Vec example in python","user":{"login":"anantasty","id":281777,"avatar_url":"https://avatars.githubusercontent.com/u/281777?v=2","gravatar_id":"","url":"https://api.github.com/users/anantasty","html_url":"https://github.com/anantasty","followers_url":"https://api.github.com/users/anantasty/followers","following_url":"https://api.github.com/users/anantasty/following{/other_user}","gists_url":"https://api.github.com/users/anantasty/gists{/gist_id}","starred_url":"https://api.github.com/users/anantasty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anantasty/subscriptions","organizations_url":"https://api.github.com/users/anantasty/orgs","repos_url":"https://api.github.com/users/anantasty/repos","events_url":"https://api.github.com/users/anantasty/events{/privacy}","received_events_url":"https://api.github.com/users/anantasty/received_events","type":"User","site_admin":false},"body":"This pull request refers to issue: https://issues.apache.org/jira/browse/SPARK-3838\r\n\r\nPython example for word2vec\r\n@mengxr ","created_at":"2014-10-27T01:52:55Z","updated_at":"2014-10-28T05:22:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0be718ffa300498cf7b6da9c508d933838a15468","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/2952/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/2952/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments/{number}","comments_url":"https://api.github.com/repos/apache/spark/issues/2952/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/ee4f5f60725ac0e94ab6cc4969fa31b8bcf6d4f2","head":{"label":"anantasty:SPARK-3838","ref":"SPARK-3838","sha":"ee4f5f60725ac0e94ab6cc4969fa31b8bcf6d4f2","user":{"login":"anantasty","id":281777,"avatar_url":"https://avatars.githubusercontent.com/u/281777?v=2","gravatar_id":"","url":"https://api.github.com/users/anantasty","html_url":"https://github.com/anantasty","followers_url":"https://api.github.com/users/anantasty/followers","following_url":"https://api.github.com/users/anantasty/following{/other_user}","gists_url":"https://api.github.com/users/anantasty/gists{/gist_id}","starred_url":"https://api.github.com/users/anantasty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anantasty/subscriptions","organizations_url":"https://api.github.com/users/anantasty/orgs","repos_url":"https://api.github.com/users/anantasty/repos","events_url":"https://api.github.com/users/anantasty/events{/privacy}","received_events_url":"https://api.github.com/users/anantasty/received_events","type":"User","site_admin":false},"repo":{"id":20410055,"name":"spark","full_name":"anantasty/spark","owner":{"login":"anantasty","id":281777,"avatar_url":"https://avatars.githubusercontent.com/u/281777?v=2","gravatar_id":"","url":"https://api.github.com/users/anantasty","html_url":"https://github.com/anantasty","followers_url":"https://api.github.com/users/anantasty/followers","following_url":"https://api.github.com/users/anantasty/following{/other_user}","gists_url":"https://api.github.com/users/anantasty/gists{/gist_id}","starred_url":"https://api.github.com/users/anantasty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anantasty/subscriptions","organizations_url":"https://api.github.com/users/anantasty/orgs","repos_url":"https://api.github.com/users/anantasty/repos","events_url":"https://api.github.com/users/anantasty/events{/privacy}","received_events_url":"https://api.github.com/users/anantasty/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anantasty/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/anantasty/spark","forks_url":"https://api.github.com/repos/anantasty/spark/forks","keys_url":"https://api.github.com/repos/anantasty/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anantasty/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anantasty/spark/teams","hooks_url":"https://api.github.com/repos/anantasty/spark/hooks","issue_events_url":"https://api.github.com/repos/anantasty/spark/issues/events{/number}","events_url":"https://api.github.com/repos/anantasty/spark/events","assignees_url":"https://api.github.com/repos/anantasty/spark/assignees{/user}","branches_url":"https://api.github.com/repos/anantasty/spark/branches{/branch}","tags_url":"https://api.github.com/repos/anantasty/spark/tags","blobs_url":"https://api.github.com/repos/anantasty/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anantasty/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anantasty/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/anantasty/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anantasty/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/anantasty/spark/languages","stargazers_url":"https://api.github.com/repos/anantasty/spark/stargazers","contributors_url":"https://api.github.com/repos/anantasty/spark/contributors","subscribers_url":"https://api.github.com/repos/anantasty/spark/subscribers","subscription_url":"https://api.github.com/repos/anantasty/spark/subscription","commits_url":"https://api.github.com/repos/anantasty/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/anantasty/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/anantasty/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/anantasty/spark/issues/comments/{number}","contents_url":"https://api.github.com/repos/anantasty/spark/contents/{+path}","compare_url":"https://api.github.com/repos/anantasty/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anantasty/spark/merges","archive_url":"https://api.github.com/repos/anantasty/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anantasty/spark/downloads","issues_url":"https://api.github.com/repos/anantasty/spark/issues{/number}","pulls_url":"https://api.github.com/repos/anantasty/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/anantasty/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/anantasty/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anantasty/spark/labels{/name}","releases_url":"https://api.github.com/repos/anantasty/spark/releases{/id}","created_at":"2014-06-02T16:00:07Z","updated_at":"2014-06-21T01:57:59Z","pushed_at":"2014-10-28T05:00:36Z","git_url":"git://github.com/anantasty/spark.git","ssh_url":"git@github.com:anantasty/spark.git","clone_url":"https://github.com/anantasty/spark.git","svn_url":"https://github.com/anantasty/spark","homepage":null,"size":80066,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"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":"apache:master","ref":"master","sha":"6377adaf3212b4facb4af644b70b7e99455cef48","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=2","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=2","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments/{number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","created_at":"2014-02-25T08:00:08Z","updated_at":"2014-10-28T03:21:59Z","pushed_at":"2014-10-28T05:04:29Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":3780702,"stargazers_count":1851,"watchers_count":1851,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1629,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":288,"forks":1629,"open_issues":288,"watchers":1851,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/2952"},"html":{"href":"https://github.com/apache/spark/pull/2952"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/2952"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/2952/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/2952/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/2952/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/ee4f5f60725ac0e94ab6cc4969fa31b8bcf6d4f2"}}}}