Skip to content

Commit

Permalink
Update 11.sentiment_analysis_with_dict.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
chengjun committed May 13, 2019
1 parent 42e17cd commit 8ee4c20
Showing 1 changed file with 72 additions and 8 deletions.
80 changes: 72 additions & 8 deletions code/11.sentiment_analysis_with_dict.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"
}
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 8ee4c20

Please sign in to comment.