{"action":"created","comment":{"url":"https://api.github.com/repos/dmlc/gluon-nlp/pulls/comments/234746249","pull_request_review_id":176454015,"id":234746249,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDc0NjI0OQ==","diff_hunk":"@@ -0,0 +1,201 @@\n+\"\"\"\n+TextCNN Model for Sentiment Analysis\n+===============================================\n+This example shows how to use convolutional neural networks (textCNN)\n+for sentiment analysis on various datasets.\n+\n+Kim, Y. (2014). Convolutional neural networks for sentence classification.\n+arXiv preprint arXiv:1408.5882.\n+\"\"\"\n+\n+# coding: utf-8\n+\n+# Licensed to the Apache Software Foundation (ASF) under one\n+# or more contributor license agreements.  See the NOTICE file\n+# distributed with this work for additional information\n+# regarding copyright ownership.  The ASF licenses this file\n+# to you under the Apache License, Version 2.0 (the\n+# \"License\"); you may not use this file except in compliance\n+# with the License.  You may obtain a copy of the License at\n+#\n+#   http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing,\n+# software distributed under the License is distributed on an\n+# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+# KIND, either express or implied.  See the License for the\n+# specific language governing permissions and limitations\n+# under the License.\n+\n+import argparse\n+import time\n+import random\n+import numpy as np\n+\n+import mxnet as mx\n+from mxnet import nd, gluon, autograd\n+from mxnet.gluon.data import DataLoader\n+\n+import process_data\n+import text_cnn\n+\n+\n+np.random.seed(3435)\n+random.seed(3435)\n+mx.random.seed(3435)\n+\n+parser = argparse.ArgumentParser(description='Sentiment analysis with the textCNN model on\\\n+                                 various datasets.')\n+parser.add_argument('--data_name', choices=['MR', 'SST-1', 'SST-2', 'Subj', 'TREC'], default='MR',","path":"scripts/sentiment_analysis/sentiment_analysis_cnn.py","position":49,"original_position":49,"commit_id":"40a3c0a1c74a448f8abebfa259de2e3637b97657","original_commit_id":"a4544470cf3819c94fb7b5c5043c52d5fe80bb35","user":{"login":"sravanbabuiitm","id":409457,"node_id":"MDQ6VXNlcjQwOTQ1Nw==","avatar_url":"https://avatars2.githubusercontent.com/u/409457?v=4","gravatar_id":"","url":"https://api.github.com/users/sravanbabuiitm","html_url":"https://github.com/sravanbabuiitm","followers_url":"https://api.github.com/users/sravanbabuiitm/followers","following_url":"https://api.github.com/users/sravanbabuiitm/following{/other_user}","gists_url":"https://api.github.com/users/sravanbabuiitm/gists{/gist_id}","starred_url":"https://api.github.com/users/sravanbabuiitm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sravanbabuiitm/subscriptions","organizations_url":"https://api.github.com/users/sravanbabuiitm/orgs","repos_url":"https://api.github.com/users/sravanbabuiitm/repos","events_url":"https://api.github.com/users/sravanbabuiitm/events{/privacy}","received_events_url":"https://api.github.com/users/sravanbabuiitm/received_events","type":"User","site_admin":false},"body":"Thanks for clarification Sheng!","created_at":"2018-11-19T19:13:22Z","updated_at":"2018-11-19T19:13:22Z","html_url":"https://github.com/dmlc/gluon-nlp/pull/391#discussion_r234746249","pull_request_url":"https://api.github.com/repos/dmlc/gluon-nlp/pulls/391","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/dmlc/gluon-nlp/pulls/comments/234746249"},"html":{"href":"https://github.com/dmlc/gluon-nlp/pull/391#discussion_r234746249"},"pull_request":{"href":"https://api.github.com/repos/dmlc/gluon-nlp/pulls/391"}},"in_reply_to_id":232116024},"pull_request":{"url":"https://api.github.com/repos/dmlc/gluon-nlp/pulls/391","id":229130584,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5MTMwNTg0","html_url":"https://github.com/dmlc/gluon-nlp/pull/391","diff_url":"https://github.com/dmlc/gluon-nlp/pull/391.diff","patch_url":"https://github.com/dmlc/gluon-nlp/pull/391.patch","issue_url":"https://api.github.com/repos/dmlc/gluon-nlp/issues/391","number":391,"state":"open","locked":false,"title":"add sentiment_analysis_cnn (#256)","user":{"login":"astonzhang","id":22279212,"node_id":"MDQ6VXNlcjIyMjc5MjEy","avatar_url":"https://avatars1.githubusercontent.com/u/22279212?v=4","gravatar_id":"","url":"https://api.github.com/users/astonzhang","html_url":"https://github.com/astonzhang","followers_url":"https://api.github.com/users/astonzhang/followers","following_url":"https://api.github.com/users/astonzhang/following{/other_user}","gists_url":"https://api.github.com/users/astonzhang/gists{/gist_id}","starred_url":"https://api.github.com/users/astonzhang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astonzhang/subscriptions","organizations_url":"https://api.github.com/users/astonzhang/orgs","repos_url":"https://api.github.com/users/astonzhang/repos","events_url":"https://api.github.com/users/astonzhang/events{/privacy}","received_events_url":"https://api.github.com/users/astonzhang/received_events","type":"User","site_admin":false},"body":"Merge @xiaotinghe 's PR:\r\nhttps://github.com/dmlc/gluon-nlp/pull/256\r\n\r\n## Description ##\r\nAdd sentiment analysis with textCNN including various data sets. This is intended to use convolutional neural networks (textCNN) for sentiment analysis.\r\n\r\n- Convolutional neural networks for sentiment analysis\r\n    - The script shows how to use convolutional neural networks (textCNN) for sentiment analysis on various datasets.\r\n\r\n- Various datasets for sentiment analysis.\r\n    - MR is a movie-review data set of 10,662 sentences labeled with respect to their overall sentiment polarity (positive or negative).\r\n    - SST-1 is an extension of the MR data set. However, training/test splits are provided and labels are fine-grained (very positive, positive, neutral, negative, very negative). The training and test data sets have 237,107 and 2,210 sentences respectively.\r\n    - SST-2 is the same with SST-1, but neutral sentences are removed and only binary sentiment polarity are considered: very positive is considered as positive, and very negative is considered as negative.\r\n    - SUBJ is a Subjectivity data set for sentiment analysis. Sentences labeled with respect to their subjectivity status (subjective or objective).\r\n    - TREC is a movie-review data set of 10,000 sentences labeled with respect to their subjectivity status (subjective or objective).\r\n\r\n## Checklist ##\r\n### Essentials ###\r\n- [x] Changes are complete (i.e. I finished coding on this PR)\r\n- [x] All changes have test coverage\r\n- [x] Code is well-documented\r\n\r\n### Changes ###\r\n- [x] textCNN model.\r\n- [x] textCNN running scripts.\r\n- [x] Data sets (MR, SST, Subj, and TREC)\r\n\r\n## Comments ##\r\n- N.A.\r\n","created_at":"2018-11-07T18:46:58Z","updated_at":"2018-11-19T19:13:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bab0e89f0493fba894f86eb1d270e9eb23616555","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":997120945,"node_id":"MDU6TGFiZWw5OTcxMjA5NDU=","url":"https://api.github.com/repos/dmlc/gluon-nlp/labels/release%20focus","name":"release focus","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dmlc/gluon-nlp/pulls/391/commits","review_comments_url":"https://api.github.com/repos/dmlc/gluon-nlp/pulls/391/comments","review_comment_url":"https://api.github.com/repos/dmlc/gluon-nlp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dmlc/gluon-nlp/issues/391/comments","statuses_url":"https://api.github.com/repos/dmlc/gluon-nlp/statuses/40a3c0a1c74a448f8abebfa259de2e3637b97657","head":{"label":"dmlc:sentiment","ref":"sentiment","sha":"40a3c0a1c74a448f8abebfa259de2e3637b97657","user":{"login":"dmlc","id":11508361,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTA4MzYx","avatar_url":"https://avatars2.githubusercontent.com/u/11508361?v=4","gravatar_id":"","url":"https://api.github.com/users/dmlc","html_url":"https://github.com/dmlc","followers_url":"https://api.github.com/users/dmlc/followers","following_url":"https://api.github.com/users/dmlc/following{/other_user}","gists_url":"https://api.github.com/users/dmlc/gists{/gist_id}","starred_url":"https://api.github.com/users/dmlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmlc/subscriptions","organizations_url":"https://api.github.com/users/dmlc/orgs","repos_url":"https://api.github.com/users/dmlc/repos","events_url":"https://api.github.com/users/dmlc/events{/privacy}","received_events_url":"https://api.github.com/users/dmlc/received_events","type":"Organization","site_admin":false},"repo":{"id":128121076,"node_id":"MDEwOlJlcG9zaXRvcnkxMjgxMjEwNzY=","name":"gluon-nlp","full_name":"dmlc/gluon-nlp","private":false,"owner":{"login":"dmlc","id":11508361,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTA4MzYx","avatar_url":"https://avatars2.githubusercontent.com/u/11508361?v=4","gravatar_id":"","url":"https://api.github.com/users/dmlc","html_url":"https://github.com/dmlc","followers_url":"https://api.github.com/users/dmlc/followers","following_url":"https://api.github.com/users/dmlc/following{/other_user}","gists_url":"https://api.github.com/users/dmlc/gists{/gist_id}","starred_url":"https://api.github.com/users/dmlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmlc/subscriptions","organizations_url":"https://api.github.com/users/dmlc/orgs","repos_url":"https://api.github.com/users/dmlc/repos","events_url":"https://api.github.com/users/dmlc/events{/privacy}","received_events_url":"https://api.github.com/users/dmlc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dmlc/gluon-nlp","description":"NLP made easy","fork":false,"url":"https://api.github.com/repos/dmlc/gluon-nlp","forks_url":"https://api.github.com/repos/dmlc/gluon-nlp/forks","keys_url":"https://api.github.com/repos/dmlc/gluon-nlp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmlc/gluon-nlp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmlc/gluon-nlp/teams","hooks_url":"https://api.github.com/repos/dmlc/gluon-nlp/hooks","issue_events_url":"https://api.github.com/repos/dmlc/gluon-nlp/issues/events{/number}","events_url":"https://api.github.com/repos/dmlc/gluon-nlp/events","assignees_url":"https://api.github.com/repos/dmlc/gluon-nlp/assignees{/user}","branches_url":"https://api.github.com/repos/dmlc/gluon-nlp/branches{/branch}","tags_url":"https://api.github.com/repos/dmlc/gluon-nlp/tags","blobs_url":"https://api.github.com/repos/dmlc/gluon-nlp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmlc/gluon-nlp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmlc/gluon-nlp/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmlc/gluon-nlp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmlc/gluon-nlp/statuses/{sha}","languages_url":"https://api.github.com/repos/dmlc/gluon-nlp/languages","stargazers_url":"https://api.github.com/repos/dmlc/gluon-nlp/stargazers","contributors_url":"https://api.github.com/repos/dmlc/gluon-nlp/contributors","subscribers_url":"https://api.github.com/repos/dmlc/gluon-nlp/subscribers","subscription_url":"https://api.github.com/repos/dmlc/gluon-nlp/subscription","commits_url":"https://api.github.com/repos/dmlc/gluon-nlp/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmlc/gluon-nlp/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmlc/gluon-nlp/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmlc/gluon-nlp/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmlc/gluon-nlp/contents/{+path}","compare_url":"https://api.github.com/repos/dmlc/gluon-nlp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmlc/gluon-nlp/merges","archive_url":"https://api.github.com/repos/dmlc/gluon-nlp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmlc/gluon-nlp/downloads","issues_url":"https://api.github.com/repos/dmlc/gluon-nlp/issues{/number}","pulls_url":"https://api.github.com/repos/dmlc/gluon-nlp/pulls{/number}","milestones_url":"https://api.github.com/repos/dmlc/gluon-nlp/milestones{/number}","notifications_url":"https://api.github.com/repos/dmlc/gluon-nlp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmlc/gluon-nlp/labels{/name}","releases_url":"https://api.github.com/repos/dmlc/gluon-nlp/releases{/id}","deployments_url":"https://api.github.com/repos/dmlc/gluon-nlp/deployments","created_at":"2018-04-04T20:57:13Z","updated_at":"2018-11-19T17:27:34Z","pushed_at":"2018-11-19T18:15:41Z","git_url":"git://github.com/dmlc/gluon-nlp.git","ssh_url":"git@github.com:dmlc/gluon-nlp.git","clone_url":"https://github.com/dmlc/gluon-nlp.git","svn_url":"https://github.com/dmlc/gluon-nlp","homepage":"http://gluon-nlp.mxnet.io","size":5555,"stargazers_count":1080,"watchers_count":1080,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":219,"mirror_url":null,"archived":false,"open_issues_count":56,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":219,"open_issues":56,"watchers":1080,"default_branch":"master"}},"base":{"label":"dmlc:master","ref":"master","sha":"5605a8856c9e122ee7caeaa605cbdc6e069d3a19","user":{"login":"dmlc","id":11508361,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTA4MzYx","avatar_url":"https://avatars2.githubusercontent.com/u/11508361?v=4","gravatar_id":"","url":"https://api.github.com/users/dmlc","html_url":"https://github.com/dmlc","followers_url":"https://api.github.com/users/dmlc/followers","following_url":"https://api.github.com/users/dmlc/following{/other_user}","gists_url":"https://api.github.com/users/dmlc/gists{/gist_id}","starred_url":"https://api.github.com/users/dmlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmlc/subscriptions","organizations_url":"https://api.github.com/users/dmlc/orgs","repos_url":"https://api.github.com/users/dmlc/repos","events_url":"https://api.github.com/users/dmlc/events{/privacy}","received_events_url":"https://api.github.com/users/dmlc/received_events","type":"Organization","site_admin":false},"repo":{"id":128121076,"node_id":"MDEwOlJlcG9zaXRvcnkxMjgxMjEwNzY=","name":"gluon-nlp","full_name":"dmlc/gluon-nlp","private":false,"owner":{"login":"dmlc","id":11508361,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNTA4MzYx","avatar_url":"https://avatars2.githubusercontent.com/u/11508361?v=4","gravatar_id":"","url":"https://api.github.com/users/dmlc","html_url":"https://github.com/dmlc","followers_url":"https://api.github.com/users/dmlc/followers","following_url":"https://api.github.com/users/dmlc/following{/other_user}","gists_url":"https://api.github.com/users/dmlc/gists{/gist_id}","starred_url":"https://api.github.com/users/dmlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmlc/subscriptions","organizations_url":"https://api.github.com/users/dmlc/orgs","repos_url":"https://api.github.com/users/dmlc/repos","events_url":"https://api.github.com/users/dmlc/events{/privacy}","received_events_url":"https://api.github.com/users/dmlc/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dmlc/gluon-nlp","description":"NLP made easy","fork":false,"url":"https://api.github.com/repos/dmlc/gluon-nlp","forks_url":"https://api.github.com/repos/dmlc/gluon-nlp/forks","keys_url":"https://api.github.com/repos/dmlc/gluon-nlp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmlc/gluon-nlp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmlc/gluon-nlp/teams","hooks_url":"https://api.github.com/repos/dmlc/gluon-nlp/hooks","issue_events_url":"https://api.github.com/repos/dmlc/gluon-nlp/issues/events{/number}","events_url":"https://api.github.com/repos/dmlc/gluon-nlp/events","assignees_url":"https://api.github.com/repos/dmlc/gluon-nlp/assignees{/user}","branches_url":"https://api.github.com/repos/dmlc/gluon-nlp/branches{/branch}","tags_url":"https://api.github.com/repos/dmlc/gluon-nlp/tags","blobs_url":"https://api.github.com/repos/dmlc/gluon-nlp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmlc/gluon-nlp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmlc/gluon-nlp/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmlc/gluon-nlp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmlc/gluon-nlp/statuses/{sha}","languages_url":"https://api.github.com/repos/dmlc/gluon-nlp/languages","stargazers_url":"https://api.github.com/repos/dmlc/gluon-nlp/stargazers","contributors_url":"https://api.github.com/repos/dmlc/gluon-nlp/contributors","subscribers_url":"https://api.github.com/repos/dmlc/gluon-nlp/subscribers","subscription_url":"https://api.github.com/repos/dmlc/gluon-nlp/subscription","commits_url":"https://api.github.com/repos/dmlc/gluon-nlp/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmlc/gluon-nlp/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmlc/gluon-nlp/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmlc/gluon-nlp/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmlc/gluon-nlp/contents/{+path}","compare_url":"https://api.github.com/repos/dmlc/gluon-nlp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmlc/gluon-nlp/merges","archive_url":"https://api.github.com/repos/dmlc/gluon-nlp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmlc/gluon-nlp/downloads","issues_url":"https://api.github.com/repos/dmlc/gluon-nlp/issues{/number}","pulls_url":"https://api.github.com/repos/dmlc/gluon-nlp/pulls{/number}","milestones_url":"https://api.github.com/repos/dmlc/gluon-nlp/milestones{/number}","notifications_url":"https://api.github.com/repos/dmlc/gluon-nlp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmlc/gluon-nlp/labels{/name}","releases_url":"https://api.github.com/repos/dmlc/gluon-nlp/releases{/id}","deployments_url":"https://api.github.com/repos/dmlc/gluon-nlp/deployments","created_at":"2018-04-04T20:57:13Z","updated_at":"2018-11-19T17:27:34Z","pushed_at":"2018-11-19T18:15:41Z","git_url":"git://github.com/dmlc/gluon-nlp.git","ssh_url":"git@github.com:dmlc/gluon-nlp.git","clone_url":"https://github.com/dmlc/gluon-nlp.git","svn_url":"https://github.com/dmlc/gluon-nlp","homepage":"http://gluon-nlp.mxnet.io","size":5555,"stargazers_count":1080,"watchers_count":1080,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":219,"mirror_url":null,"archived":false,"open_issues_count":56,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":219,"open_issues":56,"watchers":1080,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dmlc/gluon-nlp/pulls/391"},"html":{"href":"https://github.com/dmlc/gluon-nlp/pull/391"},"issue":{"href":"https://api.github.com/repos/dmlc/gluon-nlp/issues/391"},"comments":{"href":"https://api.github.com/repos/dmlc/gluon-nlp/issues/391/comments"},"review_comments":{"href":"https://api.github.com/repos/dmlc/gluon-nlp/pulls/391/comments"},"review_comment":{"href":"https://api.github.com/repos/dmlc/gluon-nlp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dmlc/gluon-nlp/pulls/391/commits"},"statuses":{"href":"https://api.github.com/repos/dmlc/gluon-nlp/statuses/40a3c0a1c74a448f8abebfa259de2e3637b97657"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"sravanbabuiitm"}}