From fe882c94c90d29bead99281c62e910309f04b4f7 Mon Sep 17 00:00:00 2001 From: Jieyi Ma Date: Tue, 13 Mar 2018 17:16:40 -0700 Subject: [PATCH] add remarks --- NLP_AWS_SouthPark.ipynb | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/NLP_AWS_SouthPark.ipynb b/NLP_AWS_SouthPark.ipynb index d480ee1..0c24852 100644 --- a/NLP_AWS_SouthPark.ipynb +++ b/NLP_AWS_SouthPark.ipynb @@ -29,7 +29,7 @@ }, "source": [ "

Table of Contents

\n", - "
" + "
" ] }, { @@ -101,13 +101,15 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### One text line " + "### On a text line " ] }, { "cell_type": "code", "execution_count": 2, - "metadata": {}, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "comprehend = boto3.client(service_name='comprehend', region_name='us-east-1')" @@ -150,13 +152,22 @@ } ], "source": [ - "text = \"GarrisonTrump’s solution is to violently rape all three, as he nurses a black eye and defends Trump’s actions, is painfully accurate. The parallel between Heidi and Cartman’s poisonous, yet stubborn relationship is extended to Trump’s supporters, who watch Trump’s latest gaffe on tv, and look away, unwilling to criticize him for fear of the left’s rabid gloating. This is unfortunately, exactly what’s happening.\" \n", + "text = \"Garrison Trump’s solution is to violently rape all three, as he nurses a black eye and defends Trump’s actions, is painfully accurate. The parallel between Heidi and Cartman’s poisonous, yet stubborn relationship is extended to Trump’s supporters, who watch Trump’s latest gaffe on tv, and look away, unwilling to criticize him for fear of the left’s rabid gloating. This is unfortunately, exactly what’s happening.\" \n", "\n", "print('Calling DetectSentiment')\n", "print(json.dumps(comprehend.detect_sentiment(Text=text, LanguageCode='en'), sort_keys=True, indent=4))\n", "print('End of DetectSentiment\\n')" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Seems that the review for Garrison Trump in this episode is mostly neative (a dominant proportion of 53%), and somewhat netural (41%). \n", + "\n", + "The result is not surprising, as in this episode President Garrison keeps on his campaign promise to \"fxxk them all to death\", and threaten those who against him. " + ] + }, { "cell_type": "markdown", "metadata": { @@ -170,7 +181,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### One One line" + "### On a line in review document" ] }, { @@ -261,7 +272,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "### On one movie review document" + "### On an entire movie review document" ] }, { @@ -313,7 +324,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The author's attitude towards the episode \"Doubling down\" of South Park is netural (score: 0.68) to somewhat negative (score: 0.13). " + "Regardless of an negative attitude towards Garrison, the author's attitude towards the episode \"Doubling down\" of South Park is netural (score: 0.68) to somewhat negative (score: 0.13). " ] }, {