From 8ee4c205b7af35d2169cc9888b813ca2d51b7c21 Mon Sep 17 00:00:00 2001 From: chengjun Date: Mon, 13 May 2019 10:56:15 +0800 Subject: [PATCH] Update 11.sentiment_analysis_with_dict.ipynb --- code/11.sentiment_analysis_with_dict.ipynb | 80 +++++++++++++++++++--- 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/code/11.sentiment_analysis_with_dict.ipynb b/code/11.sentiment_analysis_with_dict.ipynb index c1b76aa..0b945c2 100644 --- a/code/11.sentiment_analysis_with_dict.ipynb +++ b/code/11.sentiment_analysis_with_dict.ipynb @@ -213,6 +213,31 @@ "degree_word = open_dict(Dict = '程度级别词语', path= r'../data/Textmining/')" ] }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "ExecuteTime": { + "end_time": "2019-05-13T02:51:46.124368Z", + "start_time": "2019-05-13T02:51:46.119287Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "(225, ['extreme', '百分之百', '倍加'])" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(degree_word), degree_word[:3]" + ] + }, { "cell_type": "code", "execution_count": 4, @@ -235,15 +260,38 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 16, + "metadata": { + "ExecuteTime": { + "end_time": "2019-05-13T02:51:54.993108Z", + "start_time": "2019-05-13T02:51:54.988770Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "['百分之百', '倍加', '备至', '不得了', '不堪']" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mostdict[:5]" + ] + }, + { + "cell_type": "code", + "execution_count": 17, "metadata": { "ExecuteTime": { - "end_time": "2019-05-13T02:34:13.526907Z", - "start_time": "2019-05-13T02:34:13.182166Z" + "end_time": "2019-05-13T02:54:01.140837Z", + "start_time": "2019-05-13T02:54:00.831854Z" }, - "code_folding": [ - 0 - ], + "code_folding": [], "slideshow": { "slide_type": "subslide" } @@ -344,8 +392,24 @@ " count2.append(count1)\n", " count1 = []\n", "\n", - " return count2\n", - "\n", + " return count2" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "ExecuteTime": { + "end_time": "2019-05-13T02:54:11.950886Z", + "start_time": "2019-05-13T02:54:11.944145Z" + }, + "code_folding": [], + "slideshow": { + "slide_type": "subslide" + } + }, + "outputs": [], + "source": [ "def sentiment_score(senti_score_list):\n", " score = []\n", " for review in senti_score_list:\n",